Skip to content

up to new api: Sim_readLicenseFile -> SimLicense_start #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cmake/FindSIMMETRIX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ list(APPEND SIMMETRIX_INCLUDE_DIR
find_library(GMI_SIM_LIB gmi_sim)
find_library(APF_SIM_LIB apf_sim)

set(SIM_LIB_HINT ${SIMMETRIX_ROOT}/lib/x64_rhel7_gcc48)
message(SIMMETRIX_ROOT : ${SIMMETRIX_ROOT})
set(SIM_LIB_HINT ${SIMMETRIX_ROOT}/lib/x64_rhel8_gcc83)

find_library(SIM_DISCRETE_LIB SimDiscrete ${SIM_LIB_HINT})
find_library(SIM_MESHING_LIB SimMeshing ${SIM_LIB_HINT})
Expand All @@ -26,6 +27,8 @@ find_library(SIM_PARTITIONED_MESH_LIB SimPartitionedMesh ${SIM_LIB_HINT})
find_library(SIM_PARTITIONED_MESH_MPI_LIB SimPartitionedMesh-mpi ${SIM_LIB_HINT})
find_library(SIM_PARTITINED_WRAPPER_LIB SimPartitionWrapper-${SIM_MPI} ${SIM_LIB_HINT})
find_library(SIM_PS_KRNL_LIB pskernel ${SIM_LIB_HINT}/psKrnl)
find_library(SIM_LICENSE_LIB SimLicense ${SIM_LIB_HINT})


get_filename_component(SIM_PS_KRNL_LIB_DIR ${SIM_PS_KRNL_LIB} DIRECTORY)

Expand All @@ -40,6 +43,7 @@ list(APPEND SIMMETRIX_LIBRARIES
"${SIM_PARTITINED_WRAPPER_LIB}"
"${SIM_MODEL_LIB}"
"${SIM_PS_KRNL_LIB}"
"${SIM_LICENSE_LIB}"
)

if (PARASOLID)
Expand All @@ -55,8 +59,15 @@ find_library(TIRPC tirpc)
if (TIRPC)
list(APPEND SIMMETRIX_LIBRARIES ${TIRPC})
endif()
message(SIM_MODEL_LIB : ${SIM_MODEL_LIB})

string(REGEX REPLACE ".*/([0-9]+).[0-9]-.*" "\\1" SIM_MAJOR_VER ${SIM_MODEL_LIB})

message(SIM_MAJOR_VER : ${SIM_MAJOR_VER})
message(SIMMETRIX : ${SIMMETRIX})
message(SIMMETRIX_INCLUDE_DIR : ${SIMMETRIX_INCLUDE_DIR})
message(SIMMETRIX_LIBRARIES : ${SIMMETRIX_LIBRARIES})

find_package_handle_standard_args(SIMMETRIX DEFAULT_MSG
SIMMETRIX_INCLUDE_DIR SIMMETRIX_LIBRARIES SIM_MAJOR_VER)

Expand Down
6 changes: 4 additions & 2 deletions src/input/SimModSuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <SimErrorCodes.h>
#include <SimMeshingErrorCodes.h>
#include <SimModel.h>
#include <SimLicense.h>
#include <SimModelerUtil.h>
#ifdef PARASOLID
#include <SimParasolidKrnl.h>
Expand Down Expand Up @@ -77,7 +78,7 @@ class SimModSuite : public MeshInput {
bool m_log;

public:
SimModSuite(const char* modFile, const char* cadFile = 0L, const char* licenseFile = 0L,
SimModSuite(const char* modFile, const char* cadFile = 0L, const char* licenseFile = 0L, const char* features = 0L,
const char* meshCaseName = "mesh", const char* analysisCaseName = "analysis",
int enforceSize = 0, const char* xmlFile = 0L, const bool analyseAR = false,
const char* logFile = 0L) {
Expand All @@ -89,7 +90,7 @@ class SimModSuite : public MeshInput {
Sim_logOn(logFile);
} else
m_log = false;
Sim_readLicenseFile(licenseFile);
SimLicense_start(features, licenseFile);
MS_init();
SimDiscrete_start(0);
#ifdef PARASOLID
Expand Down Expand Up @@ -236,6 +237,7 @@ class SimModSuite : public MeshInput {
Sim_unregisterAllKeys();
if (m_log)
Sim_logOff();
SimLicense_stop();
SimPartitionedMesh_stop();
SimModel_stop();
}
Expand Down
5 changes: 4 additions & 1 deletion src/pumgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ int main(int argc, char* argv[]) {
args.addOption("vtk", 0, "Dump mesh to VTK files", utils::Args::Required, false);
args.addOption("license", 'l', "License file (only used by SimModSuite)", utils::Args::Required,
false);
args.addOption("features", 'f', "SimModSuite features (available in License file, comma unspaced separated)", utils::Args::Required,
false);
#ifdef PARASOLID
args.addOption("cad", 'c', "CAD file (only used by SimModSuite)", utils::Args::Required, false);
#endif
Expand Down Expand Up @@ -148,7 +150,8 @@ int main(int argc, char* argv[]) {

meshInput = new SimModSuite(
inputFile, args.getArgument<const char*>("cad", 0L),
args.getArgument<const char*>("license", 0L), args.getArgument<const char*>("mesh", "mesh"),
args.getArgument<const char*>("license", 0L), args.getArgument<const char*>("features", 0L),
args.getArgument<const char*>("mesh", "mesh"),
args.getArgument<const char*>("analysis", "analysis"),
args.getArgument<int>("enforce-size", 0), args.getArgument<const char*>("xml", 0L),
args.isSet("analyseAR"), args.getArgument<const char*>("sim_log", 0L));
Expand Down