Skip to content

Commit 9f45713

Browse files
committed
Updates for swig target naming, and some comments
1 parent 84d7803 commit 9f45713

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/underworld/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@
6161

6262
from ._version import __version__
6363

64-
# insert directory for binaries in python search path
64+
# insert directory for binaries (.so/.dylibs) to be found
65+
# when import libUnderworld -> import libUnderworldPy
6566
import os as _os
6667
_sys.path.append(_os.path.join(__file__[:-11],'lib'))
68+
6769
# squelch h5py/numpy future warnings
6870
import warnings as _warnings
6971
_warnings.simplefilter(action='ignore', category=FutureWarning)
@@ -77,6 +79,8 @@
7779
from . import libUnderworld as _libUnderworld
7880
from . import _stgermain
7981
_data = _libUnderworld.StGermain_Tools.StgInit( _sys.argv )
82+
83+
# LoadModules relies on the 'lib' path appended above to be correct
8084
_stgermain.LoadModules( {"import":["StgDomain","StgFEM","PICellerator","Underworld","gLucifer","Solvers"]} )
8185

8286
class _del_uw_class:

src/underworld/libUnderworld/libUnderworldPy/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ message("End Swig diagnostics:")
4141

4242
set_source_files_properties(Function.i PROPERTIES CPLUSPLUS ON SWIG_MODULE_NAME Function)
4343
swig_add_library(FunctionSwig TYPE SHARED LANGUAGE python SOURCES Function.i)
44-
set_target_properties(FunctionSwig PROPERTIES SUFFIX ".so" )
44+
set_target_properties(FunctionSwig PROPERTIES SUFFIX ".so" OUTPUT_NAME "Function")
4545
target_link_libraries(FunctionSwig PRIVATE ${UW_LIBRARIES} PRIVATE ${PETSc_LIBRARIES} PRIVATE Python3::Module)
4646

4747
set_source_files_properties(c_arrays.i PROPERTIES CPLUSPLUS ON SWIG_MODULE_NAME c_arrays)
4848
swig_add_library(c_arraysSwig TYPE SHARED LANGUAGE python SOURCES c_arrays.i)
49-
set_target_properties(c_arraysSwig PROPERTIES SUFFIX ".so")
49+
set_target_properties(c_arraysSwig PROPERTIES SUFFIX ".so" OUTPUT_NAME "c_arrays")
5050
target_link_libraries(c_arraysSwig PRIVATE ${UW_LIBRARIES} PRIVATE ${PETSc_LIBRARIES} PRIVATE Python3::Module)
5151

5252
set_source_files_properties(c_pointers.i PROPERTIES CPLUSPLUS ON SWIG_MODULE_NAME c_pointers)
5353
swig_add_library(c_pointersSwig TYPE SHARED LANGUAGE python SOURCES c_pointers.i)
54-
set_target_properties(c_pointersSwig PROPERTIES SUFFIX ".so")
54+
set_target_properties(c_pointersSwig PROPERTIES SUFFIX ".so" OUTPUT_NAME "c_pointers")
5555
target_link_libraries(c_pointersSwig PRIVATE ${UW_LIBRARIES} PRIVATE ${PETSc_LIBRARIES} PRIVATE Python3::Module)
5656

5757
set_source_files_properties(gLucifer.i PROPERTIES CPLUSPLUS ON SWIG_MODULE_NAME gLucifer)

0 commit comments

Comments
 (0)