Commit 5250a018 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

improve python module installation

parent c65693e3
......@@ -40,6 +40,7 @@ if(UNIX)
set(LINUX_NAME "")
set(LINUX_ISSUE "")
set(LIB_SUFFIX "lib64")
if(EXISTS "/etc/system-release")
file(READ "/etc/system-release" LINUX_ISSUE)
elseif (EXISTS "/etc/issue")
......
......@@ -25,6 +25,16 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/../../cmake )
# load setup flags
include(SetupFlags)
# use ccache if any
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
# Cpack Generator detection
include(DetectCpackGenerator)
# required package
FIND_PACKAGE(SWIG REQUIRED)
FIND_PACKAGE(NumPy REQUIRED)
......@@ -57,7 +67,7 @@ INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/utils )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/projects/nemodep )
INCLUDE_DIRECTORIES(${DEHNEN}/falcON/utils/inc ${DEHNEN}/falcON/inc)
INCLUDE_DIRECTORIES(${UNSIOPATH}/inc)
INCLUDE_DIRECTORIES(${UNSIOPATH}/inc ${UNSIOPATH}/include/inc $ENV{NEMO}/inc)
add_definitions(${OPT} -DNO_CUDA -DfalcON_NEMO -DfalcON_SINGLE -DNOBOOST)
......@@ -82,19 +92,17 @@ ELSE (OSX) # Linux
SET(SOEXT "so")
ENDIF(OSX)
SWIG_ADD_MODULE(${MODULENAME} python ${INTERFACE} ${execpp_sources} ${UNSIOPATH}/lib/libJCLutils.${SOEXT} ${UNSIOPATH}/lib/libJCLprojects.${SOEXT} ${UNSIOPATH}/lib/libunsio.${SOEXT} ${UNSIOPATH}/lib/libnemo.a)
SWIG_ADD_MODULE(${MODULENAME} python ${INTERFACE} ${execpp_sources} $ENV{NEMO}/lib/libJCLutils.${SOEXT} $ENV{NEMO}/lib/libJCLprojects.${SOEXT} ${UNSIOPATH}/libunsio.${SOEXT} $ENV{NEMO}/lib/libnemo.a)
# ${UNSIOPATH}/lib/libJCLprojects.${SOEXT}
SWIG_LINK_LIBRARIES(${MODULENAME} ${PYTHON_LIBRARIES} ${UNSIOPATH}/lib/libJCLutils.${SOEXT} ${UNSIOPATH}/lib/libJCLprojects.${SOEXT} ${UNSIOPATH}/lib/libunsio.${SOEXT} ${DEHNEN}/utils/lib/libWDutils.${SOEXT} ${DEHNEN}/falcON/lib/libfalcON.${SOEXT} ${UNSIOPATH}/lib/libnemo.a ${UNSIOPATH}/lib/libcpgplot.a ${UNSIOPATH}/lib/libpgplot.so ${SQLITE3_LIB_PATH}/libsqlite3.${SOEXT} X11 gfortran)
SWIG_LINK_LIBRARIES(${MODULENAME} ${PYTHON_LIBRARIES} $ENV{NEMO}/lib/libJCLutils.${SOEXT} $ENV{NEMO}/lib/libJCLprojects.${SOEXT} ${UNSIOPATH}/libunsio.${SOEXT} ${DEHNEN}/utils/lib/libWDutils.${SOEXT} ${DEHNEN}/falcON/lib/libfalcON.${SOEXT} $ENV{NEMO}/lib/libnemo.a $ENV{NEMO}/lib/libcpgplot.a $ENV{NEMO}/lib/libpgplot.so ${SQLITE3_LIB_PATH}/libsqlite3.${SOEXT} X11 gfortran)
# ----------------------------------------------------------
# Install SETUP
# ----------------------------------------------------------
mark_as_advanced(CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX ${UNSIOPATH})
set (CMAKE_INSTALL_PREFIX $ENV{NEMO})
MESSAGE( STATUS "--------> CMAKE_INSTALL_PREFIX =" ${CMAKE_INSTALL_PREFIX})
INSTALL(FILES ${PROJECT_BINARY_DIR}/_${MODULENAME}.so DESTINATION py/modules)
......
......@@ -35,13 +35,14 @@ if (NOT UNSIO_SETUP)
if (NOT UNSIO_FOUND) # try NEMO
MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " NEMO=" $ENV{NEMO})
find_library(UNSIOLIB NAMES unsio PATHS $ENV{NEMO}/lib)
find_library(UNSIOLIB NAMES unsio PATHS /usr/${LIB_SUFFIX} $ENV{NEMO}/lib)
MESSAGE (STATUS "UNSIOLIB = " ${UNSIOLIB} " NEMO=" $ENV{NEMO})
if ( NOT ${UNSIOLIB} STREQUAL UNSIOLIB-NOTFOUND)
MESSAGE(STATUS "Found UNSIOLIB in NEMO =" ${UNSIOLIB})
SET(UNSIO_FOUND TRUE)
SET(UNSIOPATH $ENV{NEMO})
MESSAGE(STATUS ">>>>>22" $ENV{NEMO})
#SET(UNSIOPATH $ENV{NEMO})
get_filename_component(UNSIOPATH ${UNSIOLIB} DIRECTORY )
MESSAGE(STATUS "UNSIOPATH = " ${UNSIOPATH} )
else ()
MESSAGE(STATUS ">>>>>2")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment