Compile issue on MacOS 10.12.4

21 views
Skip to first unread message

l...@umbc.edu

unread,
May 3, 2017, 2:14:30 PM5/3/17
to omegalib
Hi,

I tried to following the example of Solution 2 in the following link: https://github.com/uic-evl/omegalib/wiki/NewApplication

My CMakeFile.txt is as following:

cmake_minimum_required(VERSION 2.8.1)
project(myapp)

add_executable(myapp myapp.cpp)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/include)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/build/include)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/src/omicron/include)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/build/src/omicron/omicron/include)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/src/omicron/external/include)
include_directories(/Users/kai/Desktop/omegalib_install/omegalib/master/src/glew)

set_target_properties(myapp PROPERTIES FOLDER apps)
target_link_libraries(myapp omega)

I added the included_directories because it could not find the header file when I compile.

The cmake compiles. But when I run make, it gives me the following error:

/Users/kai/Desktop/omegalib_install/omegalib/master/src/omicron/include/omicron/Event.h:330:14: warning:
      destination for this 'memcpy' call is a pointer to dynamic class 'Event'; vtable
      pointer will be overwritten [-Wdynamic-class-memaccess]
    { memcpy(this, &e, sizeof(Event)); }
      ~~~~~~ ^
/Users/kai/Desktop/omegalib_install/omegalib/master/src/omicron/include/omicron/Event.h:330:14: note:
      explicitly cast the pointer to silence this warning
    { memcpy(this, &e, sizeof(Event)); }
             ^
             (void*)
In file included from /Users/kai/Desktop/omegalib_install/omegalib/master/src/apps/myapp.cpp:2:
In file included from /Users/kai/Desktop/omegalib_install/omegalib/master/include/omegaGl.h:28:
/Users/kai/Desktop/omegalib_install/omegalib/master/include/omega/glheaders.h:68:30: warning:
      'gluErrorString' is deprecated: first deprecated in macOS 10.9
      [-Wdeprecated-declarations]
                const unsigned char* str = gluErrorString(glErr);
                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:260:24: note:
      'gluErrorString' has been explicitly marked deprecated here
extern const GLubyte * gluErrorString (GLenum error) OPENGL_DEPRECATED(10_0, 10_9);
                       ^
10 warnings generated.
[100%] Linking CXX executable myapp
ld: library not found for -lomega
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [myapp] Error 1
make[1]: *** [CMakeFiles/myapp.dir/all] Error 2
make: *** [all] Error 2

Could you please give me some help? Thanks a lot!


regards,
Xiaokai

Alessandro Febretti

unread,
May 3, 2017, 4:20:17 PM5/3/17
to omegalib
Note that solution 2 is if you want to add an application directly to the omegalib build, so you would not need to have a project entry.

Also, node step 2,where you need to add your application subdir to the omegalib cmake file, so it is picked up during the build: https://github.com/uic-evl/omegalib/wiki/NewApplication#step-2-adding-the-application-to-the-omegalib-build

To see an example of this, look at the orun executable, included in omegalib:
and it is linked in the main omegalib build here: https://github.com/uic-evl/omegalib/blob/master/src/CMakeLists.txt#L58

PS: I have not answered your previous question about building an external binary using solution 1 (which is probably the correct way to go, in your case), but I hope to have time to look into that in the weekend.




l...@umbc.edu

unread,
May 3, 2017, 11:17:38 PM5/3/17
to omegalib
Hi Alessandro,

Thanks for your reply and it finally compiles! I found the compiled file in the bin folder but the files don't run properly. When I tried to run the files, it reports the following error:

Xiaokais-MacBook-Pro:bin kai$ ./orun
opening /Users/kai/Desktop/omegalib_install/omegalib/master/build/default.cfg
*** FATAL: Could not load default.cfg. Application will exit now.
Xiaokais-MacBook-Pro:bin kai$ ./apps
opening /Users/kai/Desktop/omegalib_install/omegalib/master/build/default.cfg
*** FATAL: Could not load default.cfg. Application will exit now.

apps is the example I created.

In the bin folder, there is a file named D which has the following contents:

omegalib data search paths:
::: /Users/kai/Desktop/omegalib_install/omegalib/master/build/bin
::: /Users/kai/Desktop/omegalib_install/omegalib
omegalib application config lookup:
::: trying orun/orun.cfg
::: not found, trying orun.cfg
::: not found, trying default.cfg
*** FATAL: Could not load default.cfg. Application will exit now.

It seems the errors message comes from this file.

default.cfg is found in the build folder. I found default.cfg in the omegalib/master folder, not in the build folder. I also tried to copy default.cfg to the build folder. But it still does not work. 

Could you please give some help on running the compiled files? Thanks a lot!


regards,
Xiaokai

l...@umbc.edu

unread,
May 7, 2017, 2:38:47 PM5/7/17
to omegalib
Hi Alessandro,

I somehow managed to find the file and set up the directory. When I run the orun example, it pops up a window without showing anything. In the terminal, it shows the following message:

Xiaokais-MacBook-Pro:bin kai$ ./orun
opening /Users/kai/Desktop/omegalib_install/omegalib/master/build/default.cfg
!!! Service not found: MouseService
!!! Service not found: KeyboardService
!!! Service not found: ViewRayService
Initializing mission control server on port 22500
Running default_init.py
!!! PythonInterpreter: script not found: default_init.py
[orun :: PYTHON ERROR] !!! Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name '_onAppStart' is not defined

>> omegalib 16.0
>> to get a list of quick commands type ':?'
===================== ReferenceType object leaks follow:
N5omega11LeakPrinterE: 1
N5omega13DrawInterfaceE: 1
Xiaokais-MacBook-Pro:bin kai$

What does this mean?

Thanks for your help!



regards,
Xiaokai

l...@umbc.edu

unread,
May 8, 2017, 12:39:11 PM5/8/17
to omegalib
Hi Alessandro,

I also found some example code written in Python in the folder /Users/kai/Desktop/omegalib_install/omegalib/master/modules/cyclops/examples/python. When I tried to run it with ./orun, it only pops up a window without showing anything. Is there any instruction on how to run those examples? Thanks a lot!



regards,
Xiaokai

Alessandro Febretti

unread,
May 9, 2017, 8:22:00 PM5/9/17
to omegalib
Can you show me which command you used exactly, and what was the log printed by orun?

Alessandro Febretti

unread,
May 9, 2017, 8:22:54 PM5/9/17
to omegalib
A good first example to try is spincube.py 
Reply all
Reply to author
Forward
0 new messages