build errors on mac

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

build errors on mac

Postby MrPrezident » Wed Oct 24, 2018 7:10 pm

I'm trying to use cmake to compile on mac. I edited some of the CMakeFiles.txt files to fix some cmake errors. I'm not certain that I did that correctly, but cmake is completed without error. Now, when I run make, I'm seeing the following errors:

make
Scanning dependencies of target dMath
[ 1%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dLinearAlgebra.cpp.o
[ 1%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dMathDefines.cpp.o
[ 1%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dMatrix.cpp.o
[ 2%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dQuaternion.cpp.o
[ 2%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dStdAfxMath.cpp.o
[ 2%] Building CXX object sdk/dMath/CMakeFiles/dMath.dir/dVector.cpp.o
[ 3%] Linking CXX static library libdMath.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dMathDefines.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dStdAfxMath.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dVector.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dMathDefines.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dStdAfxMath.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdMath.a(dVector.cpp.o) has no symbols
[ 3%] Built target dMath
Scanning dependencies of target dgCore
[ 4%] Building CXX object sdk/dgCore/CMakeFiles/dgCore.dir/dg.cpp.o
In file included from /tmp/newton-dynamics/sdk/dgCore/dg.cpp:22:
In file included from /tmp/newton-dynamics/sdk/dgCore/dgStdafx.h:25:
In file included from /tmp/newton-dynamics/sdk/dgCore/dgTypes.h:166:
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:28:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API void ttStartRecording(const char* const fileName);
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:29:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API void ttStopRecording();
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:31:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API int ttOpenRecord(const char* const name);
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:32:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API void ttCloseRecord(int record);
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:34:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API void ttDeleteTrack();
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:35:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or
'-fms-extensions' to enable support for __declspec attributes
DTIMETRACKER_API void ttSetTrackName(const char* const threadName);
^
/tmp/newton-dynamics/sdk/dProfiler/dTimeTracker/dTimeTracker.h:25:26: note: expanded from macro 'DTIMETRACKER_API'
#define DTIMETRACKER_API __declspec(dllimport)
^
In file included from /tmp/newton-dynamics/sdk/dgCore/dg.cpp:22:
In file included from /tmp/newton-dynamics/sdk/dgCore/dgStdafx.h:25:
/tmp/newton-dynamics/sdk/dgCore/dgTypes.h:827:4: error: "dgAtomicExchangeAndAdd implementation required"
#error "dgAtomicExchangeAndAdd implementation required"
^
/tmp/newton-dynamics/sdk/dgCore/dgTypes.h:841:4: error: "dgInterlockedExchange implementation required"
#error "dgInterlockedExchange implementation required"
^
/tmp/newton-dynamics/sdk/dgCore/dgTypes.h:855:4: error: "dgInterlockedTest implementation required"
#error "dgInterlockedTest implementation required"
^
9 errors generated.
make[2]: *** [sdk/dgCore/CMakeFiles/dgCore.dir/dg.cpp.o] Error 1
make[1]: *** [sdk/dgCore/CMakeFiles/dgCore.dir/all] Error 2
make: *** [all] Error 2
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby MrPrezident » Thu Oct 25, 2018 10:30 am

I was able to get past these errors by modifying CMakeLists.txt. Now I'm having problems with dTimeTracker compile due to missing "windows.h". I see that on one of the commits, Julio commented "made Timetracker network window only for now." Do I need this on Mac? How is this supposed to compile on Mac?
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby Julio Jerez » Thu Oct 25, 2018 11:04 am

you do not need the profiler for any build, not.

I thought it was optional in cake, if not I will see to it.

this weekend I will merge few contribution and seek if profiler is optional.

and yes some demo are disabled for now until some functionality is completed.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: build errors on mac

Postby MrPrezident » Thu Oct 25, 2018 2:24 pm

I tried to disable profiler in cmake, but then I got this error:

newton-dynamics/sdk/dgCore/dgTypes.h:166:10: fatal error: 'dTimeTracker.h' file not found
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby arpio » Thu Oct 25, 2018 5:18 pm

I'm not on Mac but try to change the line 166 in dgtypes.h to this:
#if (defined (_WIN_32_VER) || defined (_WIN_64_VER))
#include <dTimeTracker.h>
#endif
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: build errors on mac

Postby MrPrezident » Mon Oct 29, 2018 12:16 pm

Thanks. I eventually had to remove a bunch additional of references to Profiler in cmake files and then I got to the next issue, which is that the makefiles generated are referencing undefined variables called $(TargetPath) and $(TargetFileName). Where do these variables come from? Why would those not be defined?
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby arpio » Mon Oct 29, 2018 1:00 pm

Did you try with latest git sources? The profiler is now optional.
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: build errors on mac

Postby MrPrezident » Mon Oct 29, 2018 1:31 pm

ah cool. Thanks! I will give it a try.
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby MrPrezident » Mon Oct 29, 2018 2:38 pm

It is compiling now. I had to turn off NEWTON_BUILD_SANDBOX_DEMOS and also add this to the CMakeLists.txt file:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fms-extensions -std=c++11")


I wonder if it is possible to compile the demos on Mac.
MrPrezident
 
Posts: 13
Joined: Tue Oct 02, 2018 11:30 pm

Re: build errors on mac

Postby arpio » Mon Oct 29, 2018 6:31 pm

MrPrezident wrote:I wonder if it is possible to compile the demos on Mac.


Well, you would need GLFW, OpenGl and OpenAL preinstalled on your mac. Then you need to add a mac part to "applications/demosSandbox/CMakeLists.txt" similar to Windows or Unix.

Code: Select all
if (UNIX)
    target_link_libraries (${projectName} newton dgCore dgPhysics dMath dContainers dCustomJoints dScene dNewton dVehicle dCustomJoints tinyxml imgui glfw GL GLU pthread)

    set (source "${CMAKE_SOURCE_DIR}/applications/media")
    set (destination "${PROJECT_BINARY_DIR}/applications/media")
    add_custom_command(
        TARGET ${projectName} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E create_symlink ${source} ${destination}
        DEPENDS ${destination}
        COMMENT "symbolic link resources folder from ${source} => ${destination}")
endif(UNIX)


But I don't know what version of MacOS you are using. OpenGL, OpenCL deprecated in favor of Metal 2 in macOS 10.14 Mojave: https://appleinsider.com/articles/18/06 ... 014-mojave
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: build errors on mac

Postby Julio Jerez » Mon Oct 29, 2018 6:58 pm

I merged the make files now,
where the say opengl deprecated does it means the do not supporting it at all?

I would think there are hundreds of millions of Mac of apps using opengl.
Apple is big and the are known to be dicks, but I do not think even Apple can make that blunder.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: build errors on mac

Postby arpio » Mon Oct 29, 2018 9:23 pm

It looks like no OpenGl on Mac in the future. This is from the link I posted earlier:

"Given the news, it is just a matter of time until older apps using these technologies will no longer function — but they will still work for at least a year without updates."
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: build errors on mac

Postby Dave Gravel » Tue Oct 30, 2018 4:02 pm

New mac infos
https://support.apple.com/en-us/HT205073
-
I'm not so fan about mac or i-stuff, for me it is like giving more money for nothing more in return.
The only thing that you get in more is problems to create simple application and make it run on all other configs. It is without talking about what you need to pay for create public app.
Now the users need to use Metal, Metal 2 and moltengl or vulkan wrapper.
https://moltengl.com/
-
If i'm not wrong it is similar on pc about OpenGL and Vulkan future.
Currently you can run again some old gl app on pc, but surely many old app don't run anymore in future.
Many old gl apps on pc use deprecated gl code from long time.
I personally prefer a PC with Linux or Windows system + OpenGL, Vulkan or DX.
Similar with android you can use OpenGLES or Vulkan.
-
Apple just try to have the control over all + market($$$), All of this is based and running on a old free unix system :\
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 713
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: build errors on mac

Postby blackbird_dream » Fri Nov 02, 2018 10:08 am

well said
User avatar
blackbird_dream
 
Posts: 279
Joined: Wed Jun 07, 2006 3:08 pm
Location: Italy


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests