CompilingImmersaview Using CMake for Mac OS Using Curses CMake (ccmake)IntroductionMac OS has a GUI for CMake; however,because there are files that will need to be selected that reside indirectories that are typically hidden, it is better to run the Cursesversion of CMake from the command line. Before beginning usingCMake, make sure that Coin3D is installed and that the QUANTA librarynamed libquanta32.a isavailable. CMake is a programthat creates make files, or instructions to your compiler, about whereto find files when taking the source code of Immersaview and turning itinto a usable executable.Thereare two parts to compiling Immersaview.The first part involves creating a file named libQAvatar.a whichis used to manage remote mouse pointers during a collaborativesession.
Next: Installation on Mac OS Up: Installing AUTO. Specifically, PLAUT04 requires at least either SGI Open Inventor 2.5.10 or Coin3D 2.2 with SoXt 1.1.0. Download the latest realese of Coin3D, currently Coin3D-3.1. 3, from the Coin3D website at Place it into the desktop. At the end of the installation process, the libraries hab been installed at /usr/local directory.
The second part involves creating the immersaview andimmersaviewserver executables. This example is going toassume that the immersaview ZIP file was uncompressed in /immersaview.As a result, the 'base' immersaview directory is /immersaview/immersaview0.40.Additionally, for this example, all supporting software like QUANTA areassumed to be located in /immersaview /QUANTA-0.4. Finally, it isassumed that CMake was installed in /immersaview/cmakeand to run ccmake (the Curses CMake), it will be necessary to type thefollowing at the command line: /immersaview/cmake/bin/ccmake.The paths given here and throughout this document should change basedon the locations where these and other appropriate files reside.However, to give some frame of reference, the paths already describedwill serve as the example throughout this document.Creating the Makefiles for libQAvatar.aThe first task that must be completed is specifyingwhere the QAvatar source code and binaries will reside. In orderto use CMake to accomplish this task, it is going to be necessary torun CMake from the command prompt.
In general, to run CMake fromthe command line, it isnecessary to change to the directory where the build will occur. In this case, make adirectory named /immersaview/immersaview0.40/build-qavatarand move to that directory. It is not sufficient to then justtype the path to ccmake at the command line because it is necessary togive the relative (or absolute) path to the source directory used forthis build. For this part, the source directory named qavatar-src will be used and shouldbe located in /immersaview/immersaview0.40/qavatar-src.To begin this process, type the following from build-qavatar:/immersaview/cmake/bin/ccmake./qavatar-srcCMake appears with not much to see.
The firstthing that should be done is to configure the initial CMakefiles by pressing the 'C' key. This will fill the area withmany fields with different names as seen below:Each field listed here represents a directory or a filename that shouldbe specified in order to have CMake create the proper makefile togenerate libQAvatar.a.There are CMake scripts that attempt to search and find these files anddirectories. If they are successful, then everything will appearas you see above (but that does not mean that the scripts chose thecorrect locations). Usuallythe first time that configuration occurs, all of the fieldsbecome marked with an asterisk '.' regardless of whether or not theyare correct.
Typically, whenever there is incomplete, uncertain,or erroneous information for one of these fields, CMake marks thefield with an asterisk. If the information is correct, CMake willremove the asterisk. Typically after configuringCMake for the first time, just about every field is marked with anasterisk unless CMake seemed to have found the appropriate file ordirectory. Even though the asterisk would imply that the fieldmusthave some new information specified, it may not be necessary since notevery field needs to be updated in order to be correct with referenceto CMake. As a result, the fields that must be changed will bedirectly specified in this document; otherwise, it would probably bebest to leave the field as it is.
It is possible that additionalfields may cause errors that may be related to one's localconfiguration. For this reason, it is up to the user to determineand correct the source of these errors. To change the informationof a particular field, one needs to move the cursor to the field andpress the Enter or Return key. To delete thefield completely, one can press the key combination Control-K. Afterwards, onecan type the information into the field or copy it into that locationfrom another source. When one is done entering this infomation,press the Enteror Return key.Now itis time to make the necessary changes to the following fields so thatthe correct information is given to generate the makefile:QUANTAINCLUDEDIR:There is a directory named include that should reside insidethe directory where QUANTA was downloaded.
For this example, thisdirectory can be found in the following location: /immersaview/QUANTA-0.4/include.QUANTAquantaLIBRARY: The QUANTA library that must be found isnamed libquanta32.a. Tohelp keep things organized, when the author compiled QUANTA fromsource, an install directorywas made from the base QUANTA directory. It is in the install directory that libquanta32.a should exist.If someone installed QUANTA to a different location, then this pathwould probably differ. So, for this example, theabsolute path to the library is: /immersaview/QUANTA-0.4/install/lib/libquanta32.a.Once the information has beenentered, it will be necessary to configure CMake again with this newinformation by pressing the 'C' key. As long as theinformation in the specified fields is acceptable to CMake, anyasterisks that may have appeared should now have gone away. If anerror does occur,CMake will place an asterisk to the left of the field'sinformation. In this case, onecan either make the change to the erroneous field(s) or ignore theerror(s).
If one desires to fix these problems, simply make theappropriate changes to the erroneous fields and configure CMake againby pressing the 'C' key again. Repeat this process until theerrorstops occurring. Once things are configured as onewould like, press the 'G' key to generate the makefile.
Thisshould make theCMake end and return the window to the command line.Using theMakefiles to Create libQAvatar.aSince the directorythat one currently resides in is where the Makefile was created, allthat is needed to create libQAvatar.ais to type the following:make libQAvatar.aIf all of the files and directories were specified correctly, the endresult should involve libQAvatar.a beingpresent in the directory named build-qavatar.For this particular example, the location to this file is /immersaview/ immersaview0.40/build-qavatar/libQAvatar.a. Remember the location of this file since it willbe used in the next section.Creating the Makefiles for immersaview and immersaviewserverNow itis time to create the binaries named immersaviewand immersaviewserver. Again,:to run CMake fromthe command line, it isnecessary to change to the directory where the build will occur. In this case, make adirectory named /immersaview/immersaview0.40/build-immersaviewand move to that directory. It is not sufficient to then justtype the path to ccmake at the command line because it is necessary togive the relative (or absolute) path to the source directory used forthis build. For this part, the source directory named immersaview-src will be used andshouldbe located in /immersaview/immersaview0.40/immersaview-src.To begin this process, type the following from build-immersaview:/immersaview/cmake/bin/ccmake./immersaview-srcAs before, CMake appears with not much to see.The firstthing that should be done is to configure the initial CMakefiles by pressing the 'C' key. One thing that may happen is thatthe GLUT installation may not be found and an error will appear.Simply press the 'E' key to exit this help section.
Then one willsee the following:Recalling the possible GLUT directory error, itseems that there is no field for specifying anything related toGLUT. For this reason, it is necessary to view the more advancedoptions by pressing the 'T' key.
Many more fields appear as seenbelow:There are now multiple 'pages' of fields that can be specified that canbe navigated by pressing the Page Upand Page Down keys.One should also notice that almost every field has an steriskindicating that changes may need to be made in order for CMake togenerate the makefiles. However, keep in mind that it is onlynecessary to change the relevant fields and leave the other fieldsalone. Additionally, one can simply ignore erroneous fieldsas irrelevant. Ifit is uncertain where directories might reside, it isrecommended to take the 'advice' of CMake when it gives hints as towhat specific header file would reside in a given directory. Withthis in mind, do a file search if all else fails and use the file withthe most recent date. The following fieldsshould bechanged:GLUTINCLUDEDIR:According to CMake, it is necessary to find the directory that containsglut.h.
Since this is something that may not be wellknown, it may be best to search for glut.h.However, sometimes it is just better to ask someone who knows.and theperson who saw what I originally wrote recommended using /System/Library/Frameworks/GLUT.framework/Headers.INVENTOR INCLUDEDIR: It is probablyeasiest to use whatever CMake returns as the location for theCoin3D/Open Inventor include directory. It would also berecommended to install the precompiled binaries from the Coin3D websitefor your particular version of OS X. For this example, simplymake sure that the following is specified: /Library/Frameworks.INVENTORoiv LIBRARY: Again, whateverCMake returns is probably just fine if Coin3D was formally installed onyour system. Forthis example, make sure that -frameworkInventor is given.QAvatar INCLUDEDIR: Just reusethe source directory that was used to specify the location ofqavatar-src. For this example, this directory can be found inthe following location: /immersaview/immersaview0.40/qavatar-src.QAvatarLIBRARY: Thisis where that request to remember where libQAvatar.a comesin.
This library is going to be located in build-qavatar.For this example, this library can be found in thefollowing location: /immersaview/immersaview0.40/build-qavatar/libQAvatar.a.QUANTAINCLUDEDIR: Usethe same directory that was used when building libquanta32.a. For this example, this directory can be found in the followinglocation: /immersaview/QUANTA-0.4/include.QUANTAquantaLIBRARY: Use the same directory that was usedwhen building libquanta32.a. For this example, theabsolute path to the library is: /immersaview/QUANTA-0.4/install/lib/libquanta32.a.Once the information has beenentered, configure CMake by pressing the 'C' key again. As longas theinformation in the specified fields is acceptable to CMake, all of thefields should not have any asterisks near them. If an error doesoccur,CMake will put an asterisk by the problematic field.
In thiscase, onecan either make the change to the erroneous field(s) or ignore theerror(s). If one desires to fix these problems, simply make theappropriate changes to the erroneous fields and configure CMake againby pressing the 'C' key. Repeat this process until the errorstops occurring.Once things are configured as onewould like, have CMake generate the appropriate makefiles by pressingthe 'G' key.
This should make theCMake disappear and allow the command line to return to the window.Using theMakefiles to Create immersaview and immersaviewserverSince the directorythat one currently resides in is where the Makefile was created, allthat is needed to create immersaviewis to type the following:make immersaviewSimilarly, to create immersaviewserver,just type the following:make immersaviewserverBoth of these executables should now reside in build-immersaview.Filling the bin DirectoryThe pieces are now inplace to get things running. Now, it is just necessary to run onemore script that will take care of the remaining things to setup andcleanup. The name of the script to run is called setup, but at this time, setup does not do anything becauseit needs to have executable permissions. As a result, type thefollowing at the command line from /immersaview/immersaview0.40:chmod755 setupRun the script bytyping./setupNow, things should beready to go.If there are anyquestions or feedback on this document, please send mail to. Thisdocument was last revised in August 2004.
Code: →./configure -with-xercesc-lib=/opt/local/lib -with-xercesc-include=/opt/local/include -with-boost-lib=/opt/local/lib -with-boost-include=/opt/local/include -with-qt4-bin=/usr/bin -with-qt4-framework=/Library/Frameworks -with-occ-lib=/usr/local/lib/OCC -with-occ-include=/usr/local/include/OCC -with-coin=/Library/Frameworks -with-soqt=/Library/Frameworks -prefix=$PREFIX -bindir=$PREFIX/MacOS -libdir=$PREFIX/Frameworks/FreeCAD -includedir=$PREFIX/Resources/include -datarootdir=$PREFIX/Resources/sharechecking for a BSD-compatible install. /usr/bin/install -clots of stuff omittedchecking for coin-config. /usr/local/bin/coin-configchecking if we can compile and link with the Coin library. Falseconfigure: WARNING:Compilation and/or linking with the Coin main library SDK failed, forunknown reason. If you are familiar with configure-based configurationand building, investigate the 'config.log' file for clues.If you can not figure out what went wrong, please forward the 'config.log'file to the email address and ask for help bydescribing the situation where this failed.configure: error:. Cannot find Coin devel files.It appears that coin gets installed as Inventor in /Library/Frameworks.
Code: port install qt4-mac-develin /opt/local/var/macports/sources/rsync.macports.org/release/ports/python/py25-pyqt4modify Portfile for py25-pyqt4 to depend on qt4-mac-devel (originally qt4-mac)(n.b. It's possible that this is an architecture problem (if you're on 64-bit), so re-compiling everything may do the trick as Jukka says. My development system is 32-bit, so I haven't been able to help much in this regard. However, I can confirm that FreeCAD built for 32-bit runs fine on 64-bit systems - this isn't the Windows world after all. Before re-compiling all the libraries, I'd try a couple of things first:.
Delete /Library/Frameworks/Inventor.framework (Coin3D) and re-install it from the disk image. Make sure you install Coin3D and CoinTools. This seems to have worked for one user:.
If you still get the same error, you can try building for 32-bit only. Code: CMake Error at CMakeLists.txt:775 (MESSAGE):Coin3D not found.I've tried uninstalling coin and re-installing it (I used homebrew to install version 3.1.3). I'm still new to compiling from source but have also been going through the cmake configuration files. I thought that perhaps cmake may not be searching in the correct directories for coin so I tried to edit the findCoin3D.cmake file to add in additional subdirectories. But, none of it seems to work.I really do want to get my hands on FreeCAD so would appreciate any help!Below is the entire output from using cmake. Hi nightprowler,Welcome to the forum, quite an old thread you've found!I'd take that DPYTHONLIBRARY=.
Out for now and try again. Not sure what that would have to do with Coin, but it shouldn't be necessary any more. Then, you'll need to clear out your cmake cache; easiest way to do that will be to delete your freecad-build directory and make a new one.Next thing to try if that doesn't work is to check out the 0.16 source code so we know you're not encountering a new bug. Cd to the git source directory and do 'git checkout 0.16'. It should say something about being in detached HEAD state (not as bad as it sounds), and end with 'HEAD is now at ca7c5d3.
Updated translations'. Then, go back and try the cmake.Let us know how it goes.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |