New patches to the linux makefile

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

New patches to the linux makefile

Postby carli2 » Thu Aug 09, 2012 10:09 am

Hi,

this patch fixes compiling with latest newton:

Code: Select all
Index: coreLibrary_300/projects/posix64/makefile
===================================================================
--- coreLibrary_300/projects/posix64/makefile   (revision 2389)
+++ coreLibrary_300/projects/posix64/makefile   (working copy)
@@ -43,8 +43,7 @@
    $(DG_PATH)dgRandom.cpp \
    $(DG_PATH)dgRefCounter.cpp \
    $(DG_PATH)dgRef.cpp \
-   $(DG_PATH)dgSimd_128.cpp \
-   $(DG_PATH)dgSimd_256.cpp \
+   $(DG_PATH)dgSimd4.cpp \
    $(DG_PATH)dgSmallDeterminant.cpp \
    $(DG_PATH)dgSPDMatrix.cpp \
    $(DG_PATH)dgSphere.cpp \
@@ -53,6 +52,10 @@
    $(DG_PATH)dgTree.cpp \
    $(DG_PATH)dgTypes.cpp
 
+DG_INCLUDED_OPENCL_PATH = ../../source/openCL
+DG_OPENCL_PATH = $(DG_INCLUDED_OPENCL_PATH)/
+DG_OPENCL_SRCS = \
+   $(DG_OPENCL_PATH)dgOpenCL.cpp
 
 # ******************************************************
 #
@@ -104,7 +107,6 @@
    $(DG_PHYSICS_PATH)dgUserConstraint.cpp \
    $(DG_PHYSICS_PATH)dgWorld.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolver.cpp \
-   $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolverSimdAVX.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolverSimd.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsSimpleSolver.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsSimpleSolverSimd.cpp \
@@ -157,7 +159,7 @@
 #
 # ******************************************************
 #ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS) $(DG_AI_SRCS)
-ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS)
+ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS) $(DG_OPENCL_SRCS)
 DG_OBJ_FILES = $(ALL_SRC_FILES:.cpp=.o)
 
 COMPILER = gcc
@@ -169,7 +171,7 @@
 CPU_FLAGS = -O2 -fpic -g -msse -msse2 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant
 
 #FLAGS = -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH) -I$(DG_INCLUDED_AI_PATH)
-FLAGS = -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH)
+FLAGS = -D__DEBUG -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH) -I$(DG_INCLUDED_OPENCL_PATH)
 
 
 .SUFFIXES : .o .cpp


You can apply them to posix32 and posix64 makefile.
(btw you deprecated the mass function. how do I change the mass of an object to 0 or back to the old mass properly?)
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: New patches to the linux makefile

Postby Julio Jerez » Thu Aug 09, 2012 2:13 pm

It is not depracted I temporarrility renamed it. I will renable later

here is an exampel of teh more acuarte method to set the mass matruix

Code: Select all
   // calculate the moment of inertia and the relative center of mass of the solid
   //create the rigid body
   NewtonWorld* const world = scene->GetNewton();
   NewtonBody* const rigidBody = NewtonCreateBody (world, collision, &matrix[0][0]);



   // set the correct center of gravity for this body (these function are for legacy)
//   dVector origin;
//   dVector inertia;
//   NewtonConvexCollisionCalculateInertialMatrix (collision, &inertia[0], &origin[0]);   
//   dFloat Ixx = mass * inertia[0];
//   dFloat Iyy = mass * inertia[1];
//   dFloat Izz = mass * inertia[2];
//   NewtonBodySetCentreOfMass (rigidBody, &origin[0]);
//   NewtonBodySetMassMatrix (rigidBody, mass, Ixx, Iyy, Izz);

   // use a more convenient function for setting mass and inertia matrix
   NewtonBodySetMassProperties (rigidBody, mass, collision);


this will alway set the apropriate mass matrix, even if you upset the shape centre.

also I think you will have to post the patch again, I made many change and I bet it will report lots of conflicts.
wait until my next check in so that you submit the patch again.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New patches to the linux makefile

Postby carli2 » Sat Aug 11, 2012 8:48 am

Julio Jerez wrote:also I think you will have to post the patch again, I made many change and I bet it will report lots of conflicts.
wait until my next check in so that you submit the patch again.


There was only one change that you recompiled a .exe. The patch should work. (I'm not exactly sure if it includes all object files because I don't know/have a method to automatically view diffs at your project file)
What about the CMakeFiles? You could switch to CMake, that would solve most of the problems when you add files to the project.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron