diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9831927210..88d5777a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: - name: Evaluate test results vs Windows file run: | python $SAMNTDIR/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_win64.csv ${SAMNTDIR}/build/test_results_linux64.csv true - + - name: Run SSC Variable & SAM Defaults Differ run: | python -m pip install --upgrade pip diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index 15ea280f14..cdacf1fd99 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -110,7 +110,7 @@ else() find_library( SSC_LIB NAMES ssc.dylib ssc.lib ssc.so PATHS $ENV{SSC_LIB} $ENV{SSCDIR}/build/ssc $ENV{SSCDIR}/build/ssc/Release) - if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR MSVC) + if (CMAKE_BUILD_TYPE STREQUAL "Debug") unset(SSCD_LIB CACHE) find_library( SSCD_LIB NAMES sscd.dylib sscd.lib sscd.so @@ -118,7 +118,7 @@ else() target_link_libraries(SAM_api debug ${SSCD_LIB}) endif() - if(SAMAPI_EXPORT) # only on Unix + if(SAMAPI_EXPORT AND UNIX) # only on Unix unset(SSCE_LIB CACHE) find_library( SSCE_LIB NAMES libssc.so diff --git a/test/requirements.txt b/test/requirements.txt index c7339842bb..bfec01749b 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,2 +1,2 @@ -NREL-PySAM==3.0.0 +NLR-PySAM==8.0.0 requests diff --git a/test/run_defaults_diff.py b/test/run_defaults_diff.py index ff9e2da394..21ff199217 100644 --- a/test/run_defaults_diff.py +++ b/test/run_defaults_diff.py @@ -69,6 +69,23 @@ old_ssc = installations_dirs / "linux_64" / 'ssc.so' +# update runpath of old ssc.so (in release) - should be done in the future by the SAM build system, but for now we need to do it manually +# Set your target directory and new runpath +target_dir = Path(installations_dirs / "linux_64") +new_runpath = "$ORIGIN" # Or an absolute path like '/usr/local/lib' + +# Loop through all .so files recursively +for so_file in target_dir.glob("**/*.so"): + try: + # Run patchelf to set the rpath/runpath + subprocess.run( + ["patchelf", "--set-rpath", new_runpath, str(so_file)], check=True + ) + print(f"Successfully updated: {so_file.name}") + except subprocess.CalledProcessError as e: + print(f"Failed to update {so_file.name}: {e}") + + ssc_dir = Path(os.environ.get("SSCDIR")) new_ssc = Path(glob.glob(str(ssc_dir / "build" / "ssc" / "*ssc.so"))[0])