3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-22 20:34:38 +01:00

[build] fix intel f2py build of elk converter (#249)

* [build] fix intel f2py build of elk converter

* improvements from @wentzell
This commit is contained in:
Alexander Hampel 2024-03-08 11:06:53 -05:00 committed by GitHub
parent ae8d373c72
commit 0c9539ddf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,10 +9,15 @@ add_custom_target(${module_name} ALL
DEPENDS ${generated_module_file}
)
# for Intel fortran compilers we manually have to link against libiomp5 (-fqopenmp is always on in f2py)
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(F2PY_INTEL_OPTIONS -liomp5 --fcompiler=intelem)
endif()
##generate the fortran python wrapper shared library
add_custom_command(
OUTPUT ${generated_module_file}
COMMAND ${TRIQS_PYTHON_EXECUTABLE} -m numpy.f2py --build-dir ${CMAKE_CURRENT_BINARY_DIR}/meson --f90exec=${CMAKE_Fortran_COMPILER} --f77exec=${CMAKE_Fortran_COMPILER} -c ${fortran_src_file} -m ${module_name} > elk_f2py.log
COMMAND ${TRIQS_PYTHON_EXECUTABLE} -m numpy.f2py --build-dir ${CMAKE_CURRENT_BINARY_DIR}/meson --f90exec=${CMAKE_Fortran_COMPILER} --f77exec=${CMAKE_Fortran_COMPILER} ${F2PY_INTEL_OPTIONS} -c ${fortran_src_file} -m ${module_name} > elk_f2py.log
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)