Skip to content

Commit

Permalink
Make static libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophny committed Jan 23, 2025
1 parent a3521ac commit 10c0e3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
8 changes: 4 additions & 4 deletions CMakeSources.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

# RKF45 from https://people.sc.fsu.edu/~jburkardt/
# licenced under LGPL (see SRC/contrib/LICENSE.rkf45)
add_library ( rkf45 SHARED
add_library ( rkf45 STATIC
src/contrib/rkf45.f90
)

# Main goal (of the created build file): creating the library file.
add_library(neo SHARED
add_library(neo STATIC
src/arnoldi.f90
src/boozer.f90
src/io.f90
Expand Down Expand Up @@ -53,7 +53,7 @@ target_link_libraries(neo PRIVATE
)


add_library(magfie SHARED
add_library(magfie STATIC

# BDIVFREE
src/magfie/amn_mod.f90
Expand All @@ -78,7 +78,7 @@ add_library(magfie SHARED
src/fftw3.f90
)

add_library(mc_efit SHARED
add_library(mc_efit STATIC
src/MC/alpha_lifetime_mod.f90
src/MC/chamb_divB0.f90
src/MC/rng.f90
Expand Down
2 changes: 1 addition & 1 deletion src/hdf5_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif ()
### Find HDF5
find_package(HDF5 COMPONENTS C HL Fortran Fortran_HL REQUIRED)

add_library(hdf5_tools SHARED
add_library(hdf5_tools STATIC
hdf5_tools.f90
hdf5_tools_f2003.f90
)
Expand Down
14 changes: 2 additions & 12 deletions tools/h5merge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
find_package(HDF5 COMPONENTS C HL Fortran Fortran_HL)

find_library(HDF5_TOOLS_LIB NAMES hdf5_tools libhdf5_tools.${CMAKE_SHARED_LIBRARY_SUFFIX} PATHS ${CMAKE_SOURCE_DIR}/../../build/ ${CMAKE_BINARY_DIR}/ PATH_SUFFIXES src/hdf5_tools/ NO_DEFAULT_PATH)
include_directories(${CMAKE_SOURCE_DIR}/../../build/include ${CMAKE_BINARY_DIR})

set(Interface_Libs
Expand All @@ -37,19 +36,10 @@ add_executable(${PROJECT_EXE_NAME}

### Linking
target_link_libraries(${PROJECT_EXE_NAME}
${CMAKE_SOURCE_DIR}/../../build/libneo.a
${CMAKE_SOURCE_DIR}/../../build/src/hdf5_tools/libhdf5_tools.a
${Interface_Libs}
)
if(DEFINED ENV{CODE})
target_link_libraries(${PROJECT_EXE_NAME}
${LIBNEOLIB}
${HDF5_TOOLS_LIB}
)
else()
target_link_libraries(${PROJECT_EXE_NAME}
${CMAKE_SOURCE_DIR}/../../build/libneo.so
${CMAKE_SOURCE_DIR}/../../build/libhdf5_tools.so
)
endif()


### For make install
Expand Down

0 comments on commit 10c0e3e

Please sign in to comment.