Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
CrysFML
Commits
485f77b9
Unverified
Commit
485f77b9
authored
Jul 15, 2021
by
Simon Ward
Browse files
Make compatible with upstream build
parent
3339005a
Pipeline
#10432
failed with stages
in 7 minutes and 15 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.github/workflows/build_variants.yml
View file @
485f77b9
...
...
@@ -13,7 +13,7 @@ jobs:
-
uses
:
actions/checkout@v2
-
name
:
Build manylinux wheels
run
:
docker run -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/buildscript.sh
run
:
docker run -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/
Scripts/
buildscript.sh
-
uses
:
actions/upload-artifact@v2
with
:
...
...
CMakeLists.txt
View file @
485f77b9
...
...
@@ -14,6 +14,7 @@ option(HEAP_ARRAYS "Put arrays in heap instead of stack (only for Windows ifort)
option
(
PROG_EX
"Build the Program Examples"
ON
)
option
(
PYTHON_API
"Build Python API"
OFF
)
option
(
QPARALLEL
"qparallel option for Ifort on Windows"
ON
)
option
(
PYSETUP
"Building from setup.py"
OFF
)
if
(
DEFINED CMAKE_Fortran_COMPILER
)
set
(
CMAKE_Fortran_COMPILER
${
CMAKE_Fortran_COMPILER
}
CACHE STRING
"The Fortran compiler. One of 'ifort', 'g95' or 'gfortran'."
)
...
...
Python_API/Src/CMakeLists.txt
View file @
485f77b9
...
...
@@ -58,6 +58,28 @@ endif()
# set_property(TARGET Python3_LIB PROPERTY IMPORTED_LOCATION ${PYTHON_LIBRARY_PATH})
# endif()
# Set -Wl,-undefined,dynamic_lookup to OTHER_LDFLAGS
# Set include and linking
include_directories
(
${
CRYSFML_COMMON_MODULE_DIRECTORY
}
)
target_link_libraries
(
${
LIBRARY_NAME
}
crysfml_common
)
# Fix a problem on Mac OS X when building shared libraries
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-undefined dynamic_lookup"
)
endif
()
# target_link_libraries(${LIBRARY_NAME} Python3_LIB)
# Set library extension
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES PREFIX
""
OUTPUT_NAME
${
LIBRARY_NAME
}
)
set
(
LIBRARY_FILENAME
"crysfml_api.so"
)
if
(
APPLE
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES SUFFIX
".so"
)
set
(
LIBRARY_FILENAME
"crysfml_api.so"
)
elseif
(
WIN32
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES SUFFIX
".pyd"
)
set
(
LIBRARY_FILENAME
"crysfml_api.pyd"
)
endif
()
#################################
# Documentation
#################################
...
...
@@ -106,34 +128,18 @@ add_custom_target(Python_Files ALL
${
CMAKE_COMMAND
}
-E copy_directory
${
CMAKE_CURRENT_SOURCE_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
/../Tests/CFML_api
)
add_dependencies
(
Python_Files
${
LIBRARY_NAME
}
)
if
(
NOT PYSETUP
)
add_custom_target
(
Python_SO_Files ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
LIBRARY_FILENAME
}
${
CMAKE_CURRENT_BINARY_DIR
}
/../Tests/CFML_api
)
add_dependencies
(
Python_Files
${
LIBRARY_NAME
}
)
# Set -Wl,-undefined,dynamic_lookup to OTHER_LDFLAGS
# Set include and linking
include_directories
(
${
CRYSFML_COMMON_MODULE_DIRECTORY
}
)
target_link_libraries
(
${
LIBRARY_NAME
}
crysfml_common
)
# Fix a problem on Mac OS X when building shared libraries
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-undefined dynamic_lookup"
)
endif
()
# target_link_libraries(${LIBRARY_NAME} Python3_LIB)
# Set library extension
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES PREFIX
""
OUTPUT_NAME
${
LIBRARY_NAME
}
)
set
(
LIBRARY_FILENAME
"crysfml_api.so"
)
if
(
APPLE
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES SUFFIX
".so"
)
set
(
LIBRARY_FILENAME
"crysfml_api.so"
)
elseif
(
WIN32
)
set_target_properties
(
${
LIBRARY_NAME
}
PROPERTIES SUFFIX
".pyd"
)
set
(
LIBRARY_FILENAME
"crysfml_api.pyd"
)
add_dependencies
(
Python_SO_Files
${
LIBRARY_NAME
}
)
endif
()
#################################
...
...
buildscript.sh
→
Scripts/
buildscript.sh
View file @
485f77b9
...
...
@@ -19,7 +19,7 @@ function repair_wheel {
# Compile wheels
for
PYBIN
in
/opt/python/
*
/bin
;
do
# "${PYBIN}/pip" install -r /io/dev-requirements.txt
"
${
PYBIN
}
/pip"
wheel /io/
--no-deps
-w
/io/dist/
"
${
PYBIN
}
/pip"
wheel /io/
--no-deps
--use-feature
=
in
-tree-build
-w
/io/dist/
rm
-rf
/io/build/
done
...
...
setup.py
View file @
485f77b9
...
...
@@ -224,6 +224,7 @@ class BuildCMakeExt(build_ext):
"-DUSE_HDF=OFF"
,
"-DCMAKE_BUILD_TYPE={}"
.
format
(
cfg
),
# not used on MSVC, but no harm
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}"
.
format
(
os
.
path
.
join
(
build_dir
),
'Release'
),
"-DPYSETUP=ON"
]
build_args
=
[]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment