Changeset 13749


Ignore:
Timestamp:
Oct 15, 2019 8:42:40 AM (5 weeks ago)
Author:
randersson
Message:

#5819 Fixed such that the build system identifies correct python libs depending on what type of JModelica that is being built.

Location:
branches/dev-5819
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-5819/Makefile.am

    r13693 r13749  
    9292    export PYTHONHOME=$(PYTHON64_HOME); 
    9393    cd $(abs_builddir)/ThirdParty/CasADi; \
    94     make -f Makefile install "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(TMP_CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT64_HOME)"
     94    make -f Makefile install "SWIGCHECK_BUILD_DIR=$(TMP_SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(TMP_CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT64_HOME)"
    9595    mkdir -p $(DESTDIR)$(prefix)/Python/
    96     cp -r $(CASADI_PYTHON_INST_DIR64)/casadi $(DESTDIR)$(prefix)/Python_64/
     96    cp -r $(TMP_CASADI_PYTHON_INST_DIR)/casadi $(DESTDIR)$(prefix)/Python_64/
    9797    ## temp fix
    9898    cp $(TMP_CASADI_BUILD_DIR)/swig/casadi_core.py $(DESTDIR)$(prefix)/Python_64/casadi
     
    160160TMP_CMAKE_CASADI_COMPILER_ARGS=$(CMAKE_CASADI_COMPILER_ARGS64)
    161161
    162 TMP_CASADI_INST_DIR=$(CASADI_INST_DIR64)
    163 TMP_CASADI_PLUGIN_INST_DIR=$(CASADI_PLUGIN_INST_DIR64)
    164 TMP_CASADI_PYTHON_INST_DIR=$(CASADI_PYTHON_INST_DIR64)
     162# note we set directories to those without 64bit suffix
     163TMP_CASADI_INST_DIR=$(CASADI_INST_DIR)
     164TMP_CASADI_PLUGIN_INST_DIR=$(CASADI_PLUGIN_INST_DIR)
     165TMP_CASADI_PYTHON_INST_DIR=$(CASADI_PYTHON_INST_DIR)
    165166TMP_MC_LIB=$(MC_LIB64)
    166167TMP_MC_BUILD=$(MC_BUILD64)
  • branches/dev-5819/Makefile.in

    r13693 r13749  
    350350@BUILD_WITH_PYTHON32_FALSE@TMP_CMAKE_CASADI_COMPILER_ARGS = $(CMAKE_CASADI_COMPILER_ARGS64)
    351351@BUILD_WITH_PYTHON32_TRUE@TMP_CMAKE_CASADI_COMPILER_ARGS = $(CMAKE_CASADI_COMPILER_ARGS)
    352 @BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_INST_DIR = $(CASADI_INST_DIR64)
     352
     353# note we set directories to those without 64bit suffix
     354@BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_INST_DIR = $(CASADI_INST_DIR)
    353355@BUILD_WITH_PYTHON32_TRUE@TMP_CASADI_INST_DIR = $(CASADI_INST_DIR)
    354 @BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_PLUGIN_INST_DIR = $(CASADI_PLUGIN_INST_DIR64)
     356@BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_PLUGIN_INST_DIR = $(CASADI_PLUGIN_INST_DIR)
    355357@BUILD_WITH_PYTHON32_TRUE@TMP_CASADI_PLUGIN_INST_DIR = $(CASADI_PLUGIN_INST_DIR)
    356 @BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_PYTHON_INST_DIR = $(CASADI_PYTHON_INST_DIR64)
     358@BUILD_WITH_PYTHON32_FALSE@TMP_CASADI_PYTHON_INST_DIR = $(CASADI_PYTHON_INST_DIR)
    357359@BUILD_WITH_PYTHON32_TRUE@TMP_CASADI_PYTHON_INST_DIR = $(CASADI_PYTHON_INST_DIR)
    358360@BUILD_WITH_PYTHON32_FALSE@TMP_MC_LIB = $(MC_LIB64)
     
    931933@COMPILE_WITH_IPOPT64_TRUE@ export PYTHONHOME=$(PYTHON64_HOME); 
    932934@COMPILE_WITH_IPOPT64_TRUE@ cd $(abs_builddir)/ThirdParty/CasADi; \
    933 @COMPILE_WITH_IPOPT64_TRUE@ make -f Makefile install "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(TMP_CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT64_HOME)"
     935@COMPILE_WITH_IPOPT64_TRUE@ make -f Makefile install "SWIGCHECK_BUILD_DIR=$(TMP_SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(TMP_CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT64_HOME)"
    934936@COMPILE_WITH_IPOPT64_TRUE@ mkdir -p $(DESTDIR)$(prefix)/Python/
    935 @COMPILE_WITH_IPOPT64_TRUE@ cp -r $(CASADI_PYTHON_INST_DIR64)/casadi $(DESTDIR)$(prefix)/Python_64/
     937@COMPILE_WITH_IPOPT64_TRUE@ cp -r $(TMP_CASADI_PYTHON_INST_DIR)/casadi $(DESTDIR)$(prefix)/Python_64/
    936938@COMPILE_WITH_IPOPT64_TRUE@ cp $(TMP_CASADI_BUILD_DIR)/swig/casadi_core.py $(DESTDIR)$(prefix)/Python_64/casadi
    937939@COMPILE_WITH_IPOPT64_TRUE@ export PYTHONHOME=$(ORIG_PYTHON_HOME); \
  • branches/dev-5819/configure

    r13663 r13749  
    629629JVMDLL_HOME
    630630ORIG_PATH
    631 BUILD_WITH_PYTHON32_FALSE
    632 BUILD_WITH_PYTHON32_TRUE
    633631WITH_PYTHON64_FALSE
    634632WITH_PYTHON64_TRUE
     
    640638CMAKE_PYTHON_LIB
    641639PYTHON_HOME
     640BUILD_WITH_PYTHON32_FALSE
     641BUILD_WITH_PYTHON32_TRUE
    642642HAVE_ANT_FALSE
    643643HAVE_ANT_TRUE
     
    1938419384
    1938519385
     19386# Since we always build JM 32bit together with 64bit we put this in a conditional for setting proper flags to assimulo and pyfmi
     19387# therefore BUILD_WITH_PYTHON32 is true only when PYTHON64_HOME is set
     19388 if test "x$PYTHON64_HOME" != x; then
     19389  BUILD_WITH_PYTHON32_TRUE=
     19390  BUILD_WITH_PYTHON32_FALSE='#'
     19391else
     19392  BUILD_WITH_PYTHON32_TRUE='#'
     19393  BUILD_WITH_PYTHON32_FALSE=
     19394fi
     19395
     19396if test "x$PYTHON64_HOME" != x; then
     19397    PYTHON_LIB_VERSION="libpython27.a"
     19398else
     19399    PYTHON_LIB_VERSION="libpython37.a"
     19400fi
     19401
    1938619402
    1938719403# Detect if Python installation is specified with environment var
     
    1939019406
    1939119407          PYTHON_HOME_ABS="`cd ${PYTHON_HOME}; pwd`"
    19392           { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using Python  installation ${PYTHON_HOME_ABS}" >&5
    19393 $as_echo "Using Python  installation ${PYTHON_HOME_ABS}" >&6; }
    19394           CMAKE_PYTHON_LIB="-DPYTHON_LIBRARY=${PYTHON_HOME_ABS}/libs/libpython37.a"
     19408          { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using Python  installation ${PYTHON_HOME_ABS} and Python library ${PYTHON_HOME_ABS}/libs/${PYTHON_LIB_VERSION}" >&5
     19409$as_echo "Using Python  installation ${PYTHON_HOME_ABS} and Python library ${PYTHON_HOME_ABS}/libs/${PYTHON_LIB_VERSION}" >&6; }
     19410          CMAKE_PYTHON_LIB="-DPYTHON_LIBRARY=${PYTHON_HOME_ABS}/libs/${PYTHON_LIB_VERSION}"
    1939519411          CMAKE_PYTHON_INCLUDE="-DPYTHON_INCLUDE_DIR=${PYTHON_HOME_ABS}/include"
    1939619412
     
    1942919445
    1943019446          PYTHON64_HOME_ABS="`cd ${PYTHON64_HOME}; pwd`"
    19431           { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using Python 64bit installation ${PYTHON64_HOME_ABS}" >&5
    19432 $as_echo "Using Python 64bit installation ${PYTHON64_HOME_ABS}" >&6; }
    19433           CMAKE_PYTHON64_LIB="-DPYTHON_LIBRARY=${PYTHON64_HOME_ABS}/libs/libpython37.a"
     19447          { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using Python 64bit installation ${PYTHON64_HOME_ABS} and Python library ${PYTHON64_HOME_ABS}/libs/${PYTHON_LIB_VERSION}" >&5
     19448$as_echo "Using Python 64bit installation ${PYTHON64_HOME_ABS} and Python library ${PYTHON64_HOME_ABS}/libs/${PYTHON_LIB_VERSION}" >&6; }
     19449          CMAKE_PYTHON64_LIB="-DPYTHON_LIBRARY=${PYTHON64_HOME_ABS}/libs/${PYTHON_LIB_VERSION}"
    1943419450          CMAKE_PYTHON64_INCLUDE="-DPYTHON_INCLUDE_DIR=${PYTHON64_HOME_ABS}/include"
    1943519451
     
    1946519481  WITH_PYTHON64_TRUE='#'
    1946619482  WITH_PYTHON64_FALSE=
    19467 fi
    19468 
    19469 
    19470 # Since we always build JM 32bit together with 64bit we put this in a conditional for setting proper flags to assimulo and pyfmi
    19471 # therefore BUILD_WITH_PYTHON32 is true only when PYTHON64_HOME is set
    19472  if test "x$PYTHON64_HOME" != x; then
    19473   BUILD_WITH_PYTHON32_TRUE=
    19474   BUILD_WITH_PYTHON32_FALSE='#'
    19475 else
    19476   BUILD_WITH_PYTHON32_TRUE='#'
    19477   BUILD_WITH_PYTHON32_FALSE=
    1947819483fi
    1947919484
     
    1998219987Usually this means the macro was only invoked conditionally." "$LINENO" 5
    1998319988fi
     19989if test -z "${BUILD_WITH_PYTHON32_TRUE}" && test -z "${BUILD_WITH_PYTHON32_FALSE}"; then
     19990  as_fn_error $? "conditional \"BUILD_WITH_PYTHON32\" was never defined.
     19991Usually this means the macro was only invoked conditionally." "$LINENO" 5
     19992fi
    1998419993if test -z "${WITH_PYTHON64_TRUE}" && test -z "${WITH_PYTHON64_FALSE}"; then
    1998519994  as_fn_error $? "conditional \"WITH_PYTHON64\" was never defined.
    19986 Usually this means the macro was only invoked conditionally." "$LINENO" 5
    19987 fi
    19988 if test -z "${BUILD_WITH_PYTHON32_TRUE}" && test -z "${BUILD_WITH_PYTHON32_FALSE}"; then
    19989   as_fn_error $? "conditional \"BUILD_WITH_PYTHON32\" was never defined.
    1999019995Usually this means the macro was only invoked conditionally." "$LINENO" 5
    1999119996fi
  • branches/dev-5819/configure.ac

    r13663 r13749  
    331331      [
    332332          $2="`cd ${$1}; pwd`"
    333           AC_MSG_RESULT([Using Python $7 installation ${$2}])
    334           $5="-DPYTHON_LIBRARY=${$2}/libs/libpython37.a"
     333          AC_MSG_RESULT([Using Python $7 installation ${$2} and Python library ${$2}/libs/${$8}])
     334          $5="-DPYTHON_LIBRARY=${$2}/libs/${$8}"
    335335          $6="-DPYTHON_INCLUDE_DIR=${$2}/include"
    336336      ], [
     
    353353])
    354354
    355 PYTHON_DISTRO_CHECK([PYTHON_HOME], [PYTHON_HOME_ABS], [PYTHON_LIB], [PYTHON_INCLUDE], [CMAKE_PYTHON_LIB], [CMAKE_PYTHON_INCLUDE], [])
     355# Since we always build JM 32bit together with 64bit we put this in a conditional for setting proper flags to assimulo and pyfmi
     356# therefore BUILD_WITH_PYTHON32 is true only when PYTHON64_HOME is set
     357AM_CONDITIONAL([BUILD_WITH_PYTHON32], [test "x$PYTHON64_HOME" != x])
     358if test "x$PYTHON64_HOME" != x; then
     359    PYTHON_LIB_VERSION="libpython27.a"
     360else
     361    PYTHON_LIB_VERSION="libpython37.a"
     362fi
     363
     364PYTHON_DISTRO_CHECK([PYTHON_HOME], [PYTHON_HOME_ABS], [PYTHON_LIB], [PYTHON_INCLUDE], [CMAKE_PYTHON_LIB], [CMAKE_PYTHON_INCLUDE], [], [PYTHON_LIB_VERSION])
    356365AC_SUBST(ORIG_PYTHON_HOME)
    357366ORIG_PYTHON_HOME=$PYTHON_HOME_ABS
    358367   
    359 PYTHON_DISTRO_CHECK([PYTHON64_HOME], [PYTHON64_HOME_ABS], [PYTHON64_LIB], [PYTHON64_INCLUDE], [CMAKE_PYTHON64_LIB], [CMAKE_PYTHON64_INCLUDE], [64bit])
     368PYTHON_DISTRO_CHECK([PYTHON64_HOME], [PYTHON64_HOME_ABS], [PYTHON64_LIB], [PYTHON64_INCLUDE], [CMAKE_PYTHON64_LIB], [CMAKE_PYTHON64_INCLUDE], [64bit], [PYTHON_LIB_VERSION])
    360369AM_CONDITIONAL([WITH_PYTHON64], [test "x$PYTHON64_HOME" != x])
    361 
    362 # Since we always build JM 32bit together with 64bit we put this in a conditional for setting proper flags to assimulo and pyfmi
    363 # therefore BUILD_WITH_PYTHON32 is true only when PYTHON64_HOME is set
    364 AM_CONDITIONAL([BUILD_WITH_PYTHON32], [test "x$PYTHON64_HOME" != x])
    365370
    366371AC_SUBST(ORIG_PATH)
Note: See TracChangeset for help on using the changeset viewer.