Skip to content
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

Installing mcnp2cad on a Mac #54

Open
petersondroogh opened this issue Feb 8, 2019 · 5 comments
Open

Installing mcnp2cad on a Mac #54

petersondroogh opened this issue Feb 8, 2019 · 5 comments

Comments

@petersondroogh
Copy link

I was hoping to run mcnp2cad on my mac. I was able to install cgm and armadillo on my mac. But it still did not work. I got the following error and was wondering if you have any thoughts


make
c++ -g -std=c++11 -Wall -Wextra -DUSING_CGMA -DHAVE_IGEOM_CONE -I/include -o mcnp2cad mcnp2cad.o MCNPInput.o volumes.o geometry.o ProgOptions.o   -L/lib -larmadillo
ld: warning: directory not found for option '-L/lib'
Undefined symbols for architecture x86_64:
  "CubitMessage::warningFlag", referenced from:
      CubitMessage::set_warning_flag(bool) in mcnp2cad.o
  "CubitMessage::get_message_handler()", referenced from:
      CubitSilence::CubitSilence() in mcnp2cad.o
  "CubitMessage::set_message_handler(CubitMessageHandler*)", referenced from:
      CubitSilence::CubitSilence() in mcnp2cad.o
      CubitSilence::~CubitSilence() in mcnp2cad.o
  "CubitMessage::infoFlag", referenced from:
      CubitMessage::set_info_flag(bool) in mcnp2cad.o
  "CubitMessage::instance()", referenced from:
      _main in mcnp2cad.o
      CubitSilence::CubitSilence() in mcnp2cad.o
      CubitSilence::~CubitSilence() in mcnp2cad.o
  "CubitObserver::register_static_observer(CubitObserver*)", referenced from:
      RefEntityFactory::instance() in mcnp2cad.o
  "RefEntityFactory::compress_ref_ids(char const*, int)", referenced from:
      GeometryContext::createGeometry() in mcnp2cad.o
  "RefEntityFactory::instance_", referenced from:
      RefEntityFactory::instance() in mcnp2cad.o
  "RefEntityFactory::RefEntityFactory(RefEntityFactory*)", referenced from:
      RefEntityFactory::instance() in mcnp2cad.o
  "GeometryQueryTool::set_export_allint_version(int)", referenced from:
      _main in mcnp2cad.o
  "GeometryQueryTool::instance(GeometryQueryEngine*)", referenced from:
      _main in mcnp2cad.o
  "_igeom_addenttoset_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
  "_igeom_copyent_", referenced from:
      GeometryContext::defineLatticeNode(CellCard&, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, int, int, int, std::__1::vector<iBase_EntityHandle_Private*, std::__1::allocator<iBase_EntityHandle_Private*> >&) in mcnp2cad.o
      GeometryContext::defineUniverse(int, iBase_EntityHandle_Private*, Transform const*) in mcnp2cad.o
      GeometryContext::createGraveyard(iBase_EntityHandle_Private*&) in mcnp2cad.o
      GeneralQuadraticSurface::elliptic_cone(iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_createbrick_", referenced from:
      GeometryContext::createGraveyard(iBase_EntityHandle_Private*&) in mcnp2cad.o
      BoxVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      RppVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_createcone_", referenced from:
      ConeSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      TrcVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      GeneralQuadraticSurface::elliptic_cone(iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_createcylinder_", referenced from:
      CylinderSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      RccVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      RecVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      GeneralQuadraticSurface::elliptic_cyl(iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_createentset_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
  "_igeom_createsphere_", referenced from:
      makeWorldSphere(iGeom_Instance_Private*&, double) in volumes.o
      SphereSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      EllipsoidSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_createtorus_", referenced from:
      TorusSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_deleteent_", referenced from:
      GeometryContext::defineLatticeNode(CellCard&, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, int, int, int, std::__1::vector<iBase_EntityHandle_Private*, std::__1::allocator<iBase_EntityHandle_Private*> >&) in mcnp2cad.o
      GeometryContext::defineUniverse(int, iBase_EntityHandle_Private*, Transform const*) in mcnp2cad.o
      intersectIfPossible(iGeom_Instance_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private**, bool) in mcnp2cad.o
      GeometryContext::populateCell(CellCard&, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*) in mcnp2cad.o
  "_igeom_getdescription_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
      GeometryContext::tagCellIDsAsEntNames() in mcnp2cad.o
      GeometryContext::mapSanityCheck(iBase_EntityHandle_Private**, unsigned long) in mcnp2cad.o
      GeometryContext::defineLatticeNode(CellCard&, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, int, int, int, std::__1::vector<iBase_EntityHandle_Private*, std::__1::allocator<iBase_EntityHandle_Private*> >&) in mcnp2cad.o
      boundBoxesIntersect(iGeom_Instance_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*) in mcnp2cad.o
      GeometryContext::defineUniverse(int, iBase_EntityHandle_Private*, Transform const*) in mcnp2cad.o
      intersectIfPossible(iGeom_Instance_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private**, bool) in mcnp2cad.o
      ...
  "_igeom_getentboundbox_", referenced from:
      boundBoxesIntersect(iGeom_Instance_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*) in mcnp2cad.o
  "_igeom_getentities_", referenced from:
      GeometryContext::mapSanityCheck(iBase_EntityHandle_Private**, unsigned long) in mcnp2cad.o
  "_igeom_getnumoftype_", referenced from:
      GeometryContext::mapSanityCheck(iBase_EntityHandle_Private**, unsigned long) in mcnp2cad.o
  "_igeom_getrootset_", referenced from:
      GeometryContext::mapSanityCheck(iBase_EntityHandle_Private**, unsigned long) in mcnp2cad.o
  "_igeom_gettaghandle_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
      GeometryContext::tagCellIDsAsEntNames() in mcnp2cad.o
  "_igeom_gettagsizebytes_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
      GeometryContext::tagCellIDsAsEntNames() in mcnp2cad.o
  "_igeom_imprintents_", referenced from:
      GeometryContext::createGeometry() in mcnp2cad.o
  "_igeom_intersectents_", referenced from:
      intersectIfPossible(iGeom_Instance_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private*, iBase_EntityHandle_Private**, bool) in mcnp2cad.o
      embedWithinWorld(bool, iGeom_Instance_Private*&, double, iBase_EntityHandle_Private*, bool) in volumes.o
  "_igeom_mergeents_", referenced from:
      GeometryContext::createGeometry() in mcnp2cad.o
  "_igeom_moveent_", referenced from:
      applyTransform(Transform const&, iGeom_Instance_Private*&, iBase_EntityHandle_Private*&) in volumes.o
      applyReverseTransform(Transform const&, iGeom_Instance_Private*&, iBase_EntityHandle_Private*&) in volumes.o
      SphereSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      EllipsoidSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      CylinderSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      ConeSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      TrcVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      ...
  "_igeom_newgeom_", referenced from:
      _main in mcnp2cad.o
  "_igeom_reflectent_", referenced from:
      applyTransform(Transform const&, iGeom_Instance_Private*&, iBase_EntityHandle_Private*&) in volumes.o
  "_igeom_rotateent_", referenced from:
      applyTransform(Transform const&, iGeom_Instance_Private*&, iBase_EntityHandle_Private*&) in volumes.o
      applyReverseTransform(Transform const&, iGeom_Instance_Private*&, iBase_EntityHandle_Private*&) in volumes.o
      CylinderSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      ConeSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      TorusSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      GeneralQuadraticSurface::elliptic_cone(iGeom_Instance_Private*&, double) in volumes.o
      GeneralQuadraticSurface::elliptic_cyl(iGeom_Instance_Private*&, double) in volumes.o
      ...
  "_igeom_save_", referenced from:
      GeometryContext::createGeometry() in mcnp2cad.o
  "_igeom_scaleent_", referenced from:
      EllipsoidSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      TorusSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_sectionent_", referenced from:
      PlaneSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      HexVolume::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
  "_igeom_setdata_", referenced from:
      GeometryContext::tagCellIDsAsEntNames() in mcnp2cad.o
  "_igeom_setentsetdata_", referenced from:
      GeometryContext::tagGroups() in mcnp2cad.o
  "_igeom_subtractents_", referenced from:
      GeometryContext::defineCell(CellCard&, bool, iBase_EntityHandle_Private*) in mcnp2cad.o
      GeometryContext::createGraveyard(iBase_EntityHandle_Private*&) in mcnp2cad.o
      embedWithinWorld(bool, iGeom_Instance_Private*&, double, iBase_EntityHandle_Private*, bool) in volumes.o
  "_igeom_uniteents_", referenced from:
      GeometryContext::defineCell(CellCard&, bool, iBase_EntityHandle_Private*) in mcnp2cad.o
      ConeSurface::getHandle(bool, iGeom_Instance_Private*&, double) in volumes.o
      GeneralQuadraticSurface::elliptic_cone(iGeom_Instance_Private*&, double) in volumes.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mcnp2cad] Error 1
@gonuke
Copy link
Member

gonuke commented Feb 10, 2019

Can you confirm which version of CGM you built and which underlying solid modeling engine you have used?

@petersondroogh
Copy link
Author

petersondroogh commented Feb 11, 2019 via email

@gonuke
Copy link
Member

gonuke commented Feb 11, 2019

Building CGM requires access to a solid modeling software library. CGM was originally developed on top of the ACIS solid modeling library that is used by Cubit (among others). However, the Cubit license no longer supports building CGM in this way.

There is some support for a stand-alone version of CGM that uses the OpenCascade solid modeling engine, but we do not have a lot of experience with that.

The roadmap for the most active development branch of this project is working to build the mcnp2cad capability into a plugin for Trelis & Cubit, that we hope will be available on all platforms.

@markreed
Copy link

markreed commented Jan 5, 2020

@gonuke -

I compiled/installed Eigen3, OCE, and CGM just fine, but I get a similar error type when trying to compile mcnp2cad. This is on MacOS Mojave v10.14.6. The error occurs during the build of libmcnp2cad.dylib:

MacBook-Pro:build markreed$ make clean all
[  7%] Building CXX object CMakeFiles/test_GQ.dir/test_GQ.cpp.o
[ 15%] Building CXX object CMakeFiles/test_GQ.dir/GQ_Characterize.cpp.o
[ 23%] Linking CXX executable test_GQ
[ 23%] Built target test_GQ
[ 30%] Building CXX object CMakeFiles/mcnp2cad.dir/mcnp2cad.cpp.o
[ 38%] Building CXX object CMakeFiles/mcnp2cad.dir/MCNPInput.cpp.o
[ 46%] Building CXX object CMakeFiles/mcnp2cad.dir/geometry.cpp.o
[ 53%] Building CXX object CMakeFiles/mcnp2cad.dir/volumes.cpp.o
[ 61%] Building CXX object CMakeFiles/mcnp2cad.dir/GQ_Characterize.cpp.o
[ 69%] Building CXX object CMakeFiles/mcnp2cad.dir/test_GQ.cpp.o
[ 76%] Linking CXX shared library libmcnp2cad.dylib

This error occurs during my make run, after I already successfully ran cmake like this:

cmake -B build . -DBUILD_CLI=yes -DIGEOM_LIB_DIR=/usr/local/lib/ -DIGEOM_INCLUDE_DIR=/usr/local/include/

Based on what I've seen from other Mac users online, this error type is related to some kind of compatibility issue (32-bit vs. 64-bit or different compilers for different packages), but I can't seem to fix it.

https://forums.wxwidgets.org/viewtopic.php?t=45585

One clue is that when I edit the mcnp2cad.dir/link.txt file created by cmake to link libcgm.a instead of libiGeom.a, the same type of error occurs with almost entirely different (and many fewer) specific error messages. Compare the attached text files to see the full error messages.

errMessage_libiGeom.txt
errMessage_libcgm.txt

@gonuke
Copy link
Member

gonuke commented Jan 6, 2020

I think your issue is a little different @markreed. Your build is finding the iGeom libraries, but they are not, in turn, finding the CGM libraries. Our CMakelists.txt file is probably a little underdeveloped for this scenario as we don't actively support it.

quick hack: try tweaking mcnp2cad.dir/link.txt to link both libcgm.a and libiGeom.a (although I'm not sure what order a Mac might prefer. On linux is would be the order given here.

long term solution: better integration with the products of CGM's build process to "ingest" the dependencies that is knows about regarding iGeom --> CGM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants