Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Commits
4eca761d
Commit
4eca761d
authored
8 years ago
by
Jean-Baptiste Keck
Browse files
Options
Downloads
Patches
Plain Diff
tryfix build fortran
parent
175c3e83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-2
2 additions, 2 deletions
CMakeLists.txt
setup.py.in
+22
-22
22 additions, 22 deletions
setup.py.in
with
24 additions
and
24 deletions
CMakeLists.txt
+
2
−
2
View file @
4eca761d
...
...
@@ -195,7 +195,7 @@ if(WITH_FFTW)
add_definitions
(
${
FFTW_DEFINES
}
)
endif
()
if
(
WITH_LIB
_CXX
)
if
(
USE
_CXX
)
compile_with
(
Boost REQUIRED
)
endif
()
...
...
@@ -388,7 +388,7 @@ if(USE_CXX OR USE_FORTRAN)
add_subdirectory
(
src
)
get_directory_property
(
FORTRAN_INCLUDE_DIRS
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/src
DEFINITION
FORTRAN_
INCLUDE_DIRS
)
DEFINITION INCLUDE_DIR
ECTORIE
S
)
endif
()
if
(
USE_CXX
)
...
...
This diff is collapsed.
Click to expand it.
setup.py.in
+
22
−
22
View file @
4eca761d
...
...
@@ -53,8 +53,9 @@ def parseCMakeDefines(var):
# --> res = [(
'
VAR
'
,
'
VAL1
'
), (
'
VAR2
'
,
'
VAL2
'
), (
'
VAR3
'
,
'
VAL3
'
)]
"""
defines
=
parseCMakeVar
(
var
)
if
defines
is
None
:
if
len
(
defines
)
==
0
:
return
None
# regex to match compiler defines like -DMACRO_NAME or
# -DMACRO_NAME = MACRO_VALUE
p
=
re
.
compile
(
'
\s*(?:-D)?\s*(\w+)(?:\s*=\s*(\w+))?\s*
'
)
...
...
@@ -65,7 +66,7 @@ def parseCMakeDefines(var):
if
m
:
res
.
append
(
m
.
group
(
1
,
2
))
else
:
print
"
\t
Warning: Could extract cmake define from
'"
,
d
,
"'
.
"
print
"
\t
Warning: Could
not
extract cmake define from
'"
,
d
,
"'
.
"
return
res
# --- external libraries to be linked with ---
...
...
@@ -76,20 +77,18 @@ extra_flags = []
for
lib
in
hysop_link_libraries
:
res
=
lib
.
find
(
'
framework
'
)
if
res
>=
0
:
index
=
hysop_link_libraries
.
index
(
lib
)
index
=
hysop_link_libraries
.
index
(
lib
)
filename
=
os
.
path
.
basename
(
lib
)
hysop_link_libraries
.
pop
(
index
)
filename
=
filename
.
split
(
'
.
'
)[
0
]
extra_flags
.
append
(
'
-framework
'
+
filename
)
hysop_link_libraries
+=
extra_flags
#hysop_link_libraries_names = set([])
#hysop_link_libraries_dirs = set([])
# use set to avoid dupl.
#link_list = ""
# hysop_link_libraries_names = set()
# hysop_link_libraries_dirs = set()
# for lib in hysop_link_libraries:
# hysop_link_libraries_names.add(os.path.basename(lib))
# hysop_link_libraries_dirs.add(os.path.dirname(lib))
# link_list += lib + " "
# hysop_link_libraries_names.add(os.path.basename(lib))
# hysop_link_libraries_dirs.add(os.path.dirname(lib))
# hysop_link_libraries_names = list(hysop_link_libraries_names)
# hysop_link_libraries_dirs = list(hysop_link_libraries_dirs)
...
...
@@ -134,6 +133,7 @@ def create_fortran_extension(name, pyf_file=None, src_dirs=None, sources=None,
for
sdir
in
src_dirs
:
sources
+=
glob
.
glob
(
os
.
path
.
join
(
sdir
,
'
*.f95
'
))
sources
+=
glob
.
glob
(
os
.
path
.
join
(
sdir
,
'
*.f90
'
))
# Reorder source list with fortran modules
# dependencies. It seems that this is not taken into
# account in f2py or distutils.
...
...
@@ -143,24 +143,25 @@ def create_fortran_extension(name, pyf_file=None, src_dirs=None, sources=None,
# --- set f2py options ---
f2py_options
=
[
'
--no-lower
'
,
'
--no-wrap-functions
'
]
options
=
[]
if
debug_mode
==
0
:
if
debug_mode
==
1
:
options
.
append
((
'
F2PY_REPORT_ON_ARRAY_COPY
'
,
'
1
'
))
if
os
.
uname
()[
0
]
==
'
Linux
'
:
options
.
append
((
'
F2PY_REPORT_ATEXIT
'
,
'
1
'
))
# --- set include dir ---
inc_dir
=
parseCMakeVar
(
"
@MPI_Fortran_INCLUDE_PATH@
"
)
inc_dir
.
append
(
'
@CMAKE_Fortran_MODULE_DIRECTORY@
'
)
inc_dir
=
parseCMakeVar
(
"
@FORTRAN_INCLUDE_DIRS@
"
)
inc_dir
+=
parseCMakeVar
(
"
@MPI_Fortran_INCLUDE_PATH@
"
)
inc_dir
+=
parseCMakeVar
(
'
@CMAKE_Fortran_MODULE_DIRECTORY@
'
)
# --- set compilation flags ---
fortran_flags
=
[
'
@Fortran_FLAGS@
'
]
#includes = parseCMakeVar("@FORTRAN_INCLUDE_DIRS@")
#if(includes != None):
# for exti in includes:
#i nc_dir.append(exti)
#libs += hysop_link_libraries_names
#libdir += hysop_link_libraries_dirs
# --- set include dir ---
# inc_dir += hysop_link_libraries_dirs
# --- set external libraries ---
# libs += hysop_link_libraries_names
# we trust cmake for external libraries and
# add them to linker, without using libraries option
extra_link_args
=
hysop_link_libraries
ext_fort
=
Extension
(
name
=
name
,
sources
=
sources
,
...
...
@@ -228,9 +229,8 @@ def create_swig_extension(name, inc_dirs, src_dirs=None, sources=None):
'
-c++
'
,
'
-extranative
'
,
'
-safecstrings
'
]
extern_includes
=
parseCMakeVar
(
"
@CXX_EXT_INCLUDES@
"
)
if
(
extern_includes
is
not
None
):
for
exti
in
extern_includes
:
include_dirs
.
append
(
exti
)
for
exti
in
extern_includes
:
include_dirs
.
append
(
exti
)
libraries
=
parseCMakeVar
(
"
@CXX_EXT_LIBS@
"
)
library_dirs
=
parseCMakeVar
(
"
@CXX_EXT_LIB_DIRS@
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment