Skip to content

Commit

Permalink
Fix setting include/lib dirs for generated build scripts
Browse files Browse the repository at this point in the history
Previous cleanup of this was overly agressive
  • Loading branch information
speth authored and ischoegl committed Jun 27, 2023
1 parent 37977ee commit 6b1acb9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
8 changes: 3 additions & 5 deletions samples/clib/SConscript
Expand Up @@ -15,13 +15,11 @@ for programName, sources in samples:

# Generate SConstruct files to be installed
linkflags = ["-g", localenv["thread_flags"]]
incdirs = [localenv["ct_incroot"]]
libdirs = [localenv["ct_libdir"]] + localenv["extra_lib_dirs"]
if not localenv["package_build"]:
linkflags.append(f"-Wl,-rpath,{localenv['ct_shlibdir']}")
incdirs = [localenv["ct_incroot"]]
libdirs = [localenv["ct_libdir"]] + localenv["extra_lib_dirs"]
else:
incdirs = []
libdirs = []
libdirs.extend(localenv["extra_lib_dirs"])

localenv["tmpl_compiler_flags"] = repr(localenv["CCFLAGS"])
localenv['tmpl_cantera_incdirs'] = repr([x for x in incdirs if x])
Expand Down
6 changes: 2 additions & 4 deletions samples/cxx/SConscript
Expand Up @@ -53,23 +53,21 @@ set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS})
# by the "RecursiveInstall" that grabs everything in the cxx directory.

flag_excludes = ["$(", "/TP", "$)", "/nologo"]
incdirs = [localenv["ct_incroot"]]
libdirs = [localenv["ct_libdir"]]
if localenv["package_build"]:
# Remove sysroot flags in templated output files. This only applies to the
# conda package for now.
# Users should compile against their local SDKs, which should be backwards
# compatible with the SDK used for building.
flag_excludes.extend(["-isysroot", "-mmacosx", "-march", "-mtune"
"-fdebug-prefix-map"])
incdirs = []
libdirs = []
else:
incdirs = [localenv["ct_incroot"]]
incdirs.extend([localenv["sundials_include"], localenv["boost_inc_dir"]])
incdirs.append(localenv["hdf_include"])
incdirs.extend(localenv["extra_inc_dirs"])
incdirs = list(set(incdirs))

libdirs = [localenv["ct_libdir"]]
libdirs.extend([localenv["sundials_libdir"], localenv["blas_lapack_dir"]])
libdirs.append(localenv["hdf_libdir"])
libdirs.extend(localenv["extra_lib_dirs"])
Expand Down
6 changes: 2 additions & 4 deletions samples/f77/SConscript
Expand Up @@ -25,25 +25,23 @@ for program_name, fortran_sources in samples:
linkflags = ["-g", localenv["thread_flags"]]

flag_excludes = ["$(", "/TP", "$)", "/nologo"]
incdirs = [localenv["ct_incroot"]]
libdirs = [localenv["ct_libdir"]]
if localenv["package_build"]:
# Remove sysroot flags in templated output files. This only applies to the
# conda package for now.
# Users should compile against their local SDKs, which should be backwards
# compatible with the SDK used for building.
flag_excludes.extend(["-isysroot", "-mmacosx", "-march", "-mtune",
"-fdebug-prefix-map"])
incdirs = []
libdirs = []
else:
linkflags.append(f"-Wl,-rpath,{localenv['ct_shlibdir']}")

incdirs = [localenv["ct_incroot"]]
incdirs.extend([localenv["sundials_include"], localenv["boost_inc_dir"]])
incdirs.append(localenv["hdf_include"])
incdirs.extend(localenv["extra_inc_dirs"])
incdirs = list(set(incdirs))

libdirs = [localenv["ct_libdir"]]
libdirs.extend([localenv["sundials_libdir"], localenv["blas_lapack_dir"]])
libdirs.append(localenv["hdf_libdir"])
libdirs.extend(localenv["extra_lib_dirs"])
Expand Down
5 changes: 1 addition & 4 deletions samples/f90/SConscript
Expand Up @@ -18,16 +18,13 @@ for programName, sources in samples:
# Generate SConstruct files to be installed
linkflags = ["-g", localenv["thread_flags"]]
incdirs = [pjoin(localenv["ct_incroot"], "cantera")] # path to fortran .mod
libdirs = []
libdirs = [localenv["ct_libdir"]]
if not localenv["package_build"]:
linkflags.append(f"-Wl,-rpath,{localenv['ct_shlibdir']}")
libdirs = [localenv["ct_libdir"]]
libdirs.extend([localenv["sundials_libdir"], localenv["blas_lapack_dir"]])
libdirs.append(localenv["hdf_libdir"])
libdirs.extend(localenv["extra_lib_dirs"])
libdirs = list(set(libdirs))
else:
libdirs = []

libs = ['cantera_fortran'] + localenv['cantera_libs'] + env['cxx_stdlib']

Expand Down

0 comments on commit 6b1acb9

Please sign in to comment.