Discussion:
[Opensg-users] Compiling opensg2
Daniel Sperka
2017-01-06 19:10:19 UTC
Permalink
Hi -

Can someone please give me commands to build opensg2 on linux? I'm
looking at porting existing osg1.8 code to osg2, so I need to build
libOSGSystem and libOSGWindowX (don't need GLUT or Qt)

I'm not familiar with cmake or its conventions and cannot grok the correct
incantations. Here is what I've tried so far:

* Downloaded snapshot of opensg2 from sourceforge
* create folder 'Build' root dir of opensg code
* run cmake like so:

cmake -DOpenSG_BINARY_DIR=./Build \
-DOSG_ENABLE_VTK=OFF \
-DOSG_ENABLE_C++11=ON \
-DOSG_ENABLE_FCD2CODE=ON \
-DOSG_VERBOSE_BUILD_MESSAGES=ON

[ Note - I fumbled with the variables here by scanning CCacheLists.txt -
please advise ]

* cmake gives error like this:

Error copying file "/home/dan/src/opensg2/OpenSG/OSGConfigured.h.cmake" to
"/home/dan/src/opensg2/OpenSG/Source/Base/Base/OSGConfigured.h.tmp.cmake".

- running make in spite of error gives


[---cut---]
/home/dan/src/opensg2/OpenSG/Source/Base/Base/OSGConfigured.h:14:2: error:
#endif without #if
#endif // _OSGCONFIGURED_H_
[---cut---]



*** Contents of OSGConfigured.h

[---START---]
/* #undef OSG_WITH_NVSDKCOMMON */

/* #undef OSG_WITH_NVOCLUTILS */

/* #undef OSG_WITH_CUDACOMMON */

/* #undef OSG_WITH_CUDAUTIL */

/* #undef OSG_WITH_CUDPP */

/* #undef OSG_WITH_CG */

#endif // _OSGCONFIGURED_H_
[---END---]





Clearly something is broke, and I suspect I've just missed some obvious
cmake setting. Can anyone guide me?

Thanks!

Dan
--
Daniel J. Sperka, Ph. D.
UC Davis Center for Neuroscience
Marcus Lindblom Sonestedt
2017-01-09 07:07:58 UTC
Permalink
I usually run cmake-gui which gives better help on what's missing and what
variables need to be set.

Iterate that a few times to get everything right.
If you need to repeat it for a CI system or similar, then store what
variables are set manually in a script similar to your invocation after
figuring out what through the GUI.

I've only ever built OpenSG2 on Windows, so I can't help with particulars
on your *nix system.

The copy error looks suspicios though. Can you write to that location?

Cheers,
/Marcus
Post by Daniel Sperka
Hi -
Can someone please give me commands to build opensg2 on linux? I'm
looking at porting existing osg1.8 code to osg2, so I need to build
libOSGSystem and libOSGWindowX (don't need GLUT or Qt)
I'm not familiar with cmake or its conventions and cannot grok the correct
* Downloaded snapshot of opensg2 from sourceforge
* create folder 'Build' root dir of opensg code
cmake -DOpenSG_BINARY_DIR=./Build \
-DOSG_ENABLE_VTK=OFF \
-DOSG_ENABLE_C++11=ON \
-DOSG_ENABLE_FCD2CODE=ON \
-DOSG_VERBOSE_BUILD_MESSAGES=ON
[ Note - I fumbled with the variables here by scanning CCacheLists.txt -
please advise ]
Error copying file "/home/dan/src/opensg2/OpenSG/OSGConfigured.h.cmake"
to "/home/dan/src/opensg2/OpenSG/Source/Base/Base/
OSGConfigured.h.tmp.cmake".
- running make in spite of error gives
[---cut---]
error: #endif without #if
#endif // _OSGCONFIGURED_H_
[---cut---]
*** Contents of OSGConfigured.h
[---START---]
/* #undef OSG_WITH_NVSDKCOMMON */
/* #undef OSG_WITH_NVOCLUTILS */
/* #undef OSG_WITH_CUDACOMMON */
/* #undef OSG_WITH_CUDAUTIL */
/* #undef OSG_WITH_CUDPP */
/* #undef OSG_WITH_CG */
#endif // _OSGCONFIGURED_H_
[---END---]
Clearly something is broke, and I suspect I've just missed some obvious
cmake setting. Can anyone guide me?
Thanks!
Dan
--
Daniel J. Sperka, Ph. D.
UC Davis Center for Neuroscience
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensg-users mailing list
https://lists.sourceforge.net/lists/listinfo/opensg-users
--
Med vÀnliga hÀlsningar,
Marcus Lindblom Sonestedt
*Systemarkitekt*
*BIT ADDICT *- Passion för utveckling
+46 (0)706 43 63 28
***@bitaddict.se
www.bitaddict.se
Carsten Neumann
2017-01-09 15:17:54 UTC
Permalink
Hello,

I believe the usual way to call cmake is to create the build directory,
change to it and call cmake with the path to the source dir, e.g.

mkdir build
cd build
cmake <path-to-opensg-source-tree>

I typically specify the type of build and the install destination as
well, leading to a cmake call like:

cmake -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$HOME/software/opensg2 <path-to-opensg-source-tree>

This will check for optional components (image format libraries, VTK,
Qt, etc.) and configure the build with what is available.

Cheers,
Carsten
Post by Daniel Sperka
Can someone please give me commands to build opensg2 on linux? I'm
looking at porting existing osg1.8 code to osg2, so I need to build
libOSGSystem and libOSGWindowX (don't need GLUT or Qt)
I'm not familiar with cmake or its conventions and cannot grok the
* Downloaded snapshot of opensg2 from sourceforge
* create folder 'Build' root dir of opensg code
cmake -DOpenSG_BINARY_DIR=./Build \
-DOSG_ENABLE_VTK=OFF \
-DOSG_ENABLE_C++11=ON \
-DOSG_ENABLE_FCD2CODE=ON \
-DOSG_VERBOSE_BUILD_MESSAGES=ON
[ Note - I fumbled with the variables here by scanning CCacheLists.txt -
please advise ]
Error copying file "/home/dan/src/opensg2/OpenSG/OSGConfigured.h.cmake" to
"/home/dan/src/opensg2/OpenSG/Source/Base/Base/OSGConfigured.h.tmp.cmake".
- running make in spite of error gives
[---cut---]
error: #endif without #if
#endif // _OSGCONFIGURED_H_
[---cut---]
*** Contents of OSGConfigured.h
[---START---]
/* #undef OSG_WITH_NVSDKCOMMON */
/* #undef OSG_WITH_NVOCLUTILS */
/* #undef OSG_WITH_CUDACOMMON */
/* #undef OSG_WITH_CUDAUTIL */
/* #undef OSG_WITH_CUDPP */
/* #undef OSG_WITH_CG */
#endif // _OSGCONFIGURED_H_
[---END---]
Clearly something is broke, and I suspect I've just missed some obvious
cmake setting. Can anyone guide me?
Thanks!
Dan
--
Daniel J. Sperka, Ph. D.
UC Davis Center for Neuroscience
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensg-users mailing list
https://lists.sourceforge.net/lists/listinfo/opensg-users
Loading...