Commit 23fc0820 authored by sylvain thery's avatar sylvain thery

compilation windows

parent f29adf8f
...@@ -100,6 +100,7 @@ Dart d_maison; ...@@ -100,6 +100,7 @@ Dart d_maison;
Dart Carre() Dart Carre()
{ {
return Dart::nil();
} }
...@@ -107,7 +108,7 @@ Dart Carre() ...@@ -107,7 +108,7 @@ Dart Carre()
Dart Triangle() Dart Triangle()
{ {
return Dart::nil();
} }
...@@ -141,7 +142,7 @@ void ColleMilieu(Dart d, Dart e) ...@@ -141,7 +142,7 @@ void ColleMilieu(Dart d, Dart e)
Dart Maison() Dart Maison()
{ {
return Dart::nil();
} }
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "Algo/Parallel/parallel_foreach.h" #include "Algo/Parallel/parallel_foreach.h"
#include <GL/glx.h>
using namespace CGoGN ; using namespace CGoGN ;
......
cmake_minimum_required( VERSION 2.6 ) cmake_minimum_required( VERSION 2.6 )
PROJECT( Assimp ) PROJECT( Assimp )
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
INCLUDE_DIRECTORIES( ../include ) INCLUDE_DIRECTORIES( ../include )
SET( LIBRARY_VERSION "1.0.0" ) SET( LIBRARY_VERSION "1.0.0" )
SET( LIBRARY_SOVERSION "1" ) SET( LIBRARY_SOVERSION "1" )
IF(WIN32)
SET( ENABLE_BOOST_WORKAROUND "1" )
ENDIF(WIN32)
IF ( ENABLE_BOOST_WORKAROUND ) IF ( ENABLE_BOOST_WORKAROUND )
INCLUDE_DIRECTORIES( BoostWorkaround ) INCLUDE_DIRECTORIES( BoostWorkaround )
ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND ) ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND )
MESSAGE( STATUS "Building a non-boost version of Assimp." ) MESSAGE( STATUS "Building a non-boost version of Assimp." )
ELSE ( ENABLE_BOOST_WORKAROUND ) ELSE ( ENABLE_BOOST_WORKAROUND )
FIND_PACKAGE( Boost 1.35 ) FIND_PACKAGE( Boost )
IF ( NOT Boost_FOUND ) IF ( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR MESSAGE( FATAL_ERROR
......
...@@ -11,11 +11,18 @@ find_package(GLUT) ...@@ -11,11 +11,18 @@ find_package(GLUT)
#On Windows we use AntTweakBar/OpenCTM of dependencies, not compiled #On Windows we use AntTweakBar/OpenCTM of dependencies, not compiled
IF(WIN32) IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)#release added by visual
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
add_subdirectory(Zinri/Build) add_subdirectory(Zinri/Build)
add_subdirectory(gzstream/Build) add_subdirectory(gzstream/Build)
add_subdirectory(Numerical) add_subdirectory(Numerical)
add_subdirectory(Assimp) add_subdirectory(Assimp/code)
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
endif()
ELSE(WIN32) ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_custom_target( FakeTargetOpenCTM ALL "make" add_custom_target( FakeTargetOpenCTM ALL "make"
WORKING_DIRECTORY ${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM WORKING_DIRECTORY ${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM
COMMENT "Custom compile of OpenCTM" ) COMMENT "Custom compile of OpenCTM" )
......
...@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(Numerical) project(Numerical)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
SUBDIRS(C_BLAS_LAPACK) SUBDIRS(C_BLAS_LAPACK)
......
...@@ -135,7 +135,7 @@ if(BLAS_COMPLEX16) ...@@ -135,7 +135,7 @@ if(BLAS_COMPLEX16)
${ALLBLAS} ${ZBLAS2} ${ZBLAS3}) ${ALLBLAS} ${ZBLAS2} ${ZBLAS3})
endif() endif()
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(blas ${ALLOBJ}) add_library(blas ${ALLOBJ})
if(UNIX) if(UNIX)
target_link_libraries(blas m) target_link_libraries(blas m)
......
...@@ -58,6 +58,7 @@ if(WIN32) ...@@ -58,6 +58,7 @@ if(WIN32)
endif() endif()
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c) include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c) include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h) add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
set_property(TARGET f2c PROPERTY PREFIX lib) #set_property(TARGET f2c PROPERTY PREFIX lib)
#pb sous windows avec le prefix lib
\ No newline at end of file
...@@ -376,7 +376,6 @@ if(BUILD_COMPLEX16) ...@@ -376,7 +376,6 @@ if(BUILD_COMPLEX16)
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX}) set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
endif() endif()
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(lapack ${ALLOBJ} ${ALLXOBJ}) add_library(lapack ${ALLOBJ} ${ALLXOBJ})
target_link_libraries(lapack blas) target_link_libraries(lapack blas)
...@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(Zinri) project(Zinri)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
include_directories(..) include_directories(..)
file( file(
......
...@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(gzstream) project(gzstream)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
include_directories(..) include_directories(..)
file( file(
......
...@@ -24,14 +24,20 @@ IF(WIN32) ...@@ -24,14 +24,20 @@ IF(WIN32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT) SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib) SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2) SET(LIBXML2_LIBRARIES xml2)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/include/) INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/lib/) LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty) # add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps) add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
if (EXISTS "${CGoGN_ROOT_DIR}/Perso") if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso) add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso)
endif (EXISTS "${CGoGN_ROOT_DIR}/Perso") endif (EXISTS "${CGoGN_ROOT_DIR}/Perso")
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
endif()
ELSE(WIN32) ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
find_package(DevIL) find_package(DevIL)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*******************************************************************************/ *******************************************************************************/
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/thread/barrier.hpp> #include <boost/thread/barrier.hpp>
#include <vector>
namespace CGoGN namespace CGoGN
{ {
...@@ -157,8 +157,8 @@ void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorType& fun ...@@ -157,8 +157,8 @@ void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorType& fun
template <typename PFP> template <typename PFP>
void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func, unsigned int nbth, unsigned int szbuff, const FunctorSelect& good) void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func, unsigned int nbth, unsigned int szbuff, const FunctorSelect& good)
{ {
std::vector<Dart> vd[nbth]; std::vector<Dart>* vd = new std::vector<Dart>[nbth];
boost::thread* threads[nbth]; boost::thread** threads = new boost::thread*[nbth];
CellMarker cm(map,cell); CellMarker cm(map,cell);
Dart d=map.begin(); Dart d=map.begin();
...@@ -188,7 +188,8 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func, ...@@ -188,7 +188,8 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func,
threads[i] = new boost::thread(ThreadFunctor(func, vd[i],sync1,sync2, finished)); threads[i] = new boost::thread(ThreadFunctor(func, vd[i],sync1,sync2, finished));
// and continue to traverse the map // and continue to traverse the map
std::vector<Dart> tempo[nbth]; std::vector<Dart>* tempo = new std::vector<Dart>[nbth];
for (unsigned int i=0; i<nbth; ++i) for (unsigned int i=0; i<nbth; ++i)
tempo[i].reserve(szbuff); tempo[i].reserve(szbuff);
...@@ -225,6 +226,9 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func, ...@@ -225,6 +226,9 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func,
threads[i]->join(); threads[i]->join();
delete threads[i]; delete threads[i];
} }
delete[] threads;
delete[] vd;
delete[] tempo;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define EMBNULL 0xffffffff #define EMBNULL 0xffffffff
#define NB_ORBITS 5 #define NB_ORBITS 5
#define NBTHREAD 8 #define NBTHREAD 16
#define VERTEX_ORBIT (unsigned int)(0) #define VERTEX_ORBIT (unsigned int)(0)
#define EDGE_ORBIT (unsigned int)(1) #define EDGE_ORBIT (unsigned int)(1)
......
...@@ -54,7 +54,8 @@ inline void GenericMap::deleteDart(Dart d) ...@@ -54,7 +54,8 @@ inline void GenericMap::deleteDart(Dart d)
if(emb != EMBNULL) if(emb != EMBNULL)
m_attribs[orbit].unrefLine(emb) ; m_attribs[orbit].unrefLine(emb) ;
} }
m_markerTables[DART_ORBIT]->operator[](d.index).clear() ; for (unsigned int t=0; t<m_nbThreads; ++t)
m_markerTables[DART_ORBIT][t]->operator[](d.index).clear() ;
} }
} }
......
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
#define __X_GL_H #define __X_GL_H
#define GLAPIENTRY #define GLAPIENTRY
#include <GL/glut.h> #include <GL/glut.h>
#include <GL/glx.h> #ifndef WIN32
#include <GL/glx.h>
#endif
#include "Utils/trackball.h" #include "Utils/trackball.h"
#include <IL/ilu.h> #include <IL/ilu.h>
#include <IL/ilut.h> #include <IL/ilut.h>
...@@ -109,11 +110,14 @@ protected: ...@@ -109,11 +110,14 @@ protected:
virtual void myMouseClick(int button, int state, int x, int y) {} virtual void myMouseClick(int button, int state, int x, int y) {}
#ifdef WIN32
HDC m_drawable;
HGLRC m_context;
#else
Display* m_dpy; Display* m_dpy;
GLXDrawable m_drawable; GLXDrawable m_drawable;
GLXContext m_context; GLXContext m_context;
#endif
public: public:
//! Others initialization: should be overloaded in derived classes //! Others initialization: should be overloaded in derived classes
......
...@@ -102,7 +102,8 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb) ...@@ -102,7 +102,8 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb)
if (old != EMBNULL) if (old != EMBNULL)
{ {
if(m_attribs[orbit].unrefLine(old)) if(m_attribs[orbit].unrefLine(old))
m_markerTables[orbit]->operator[](old).clear(); for (unsigned int t=0; t<m_nbThreads; ++t)
m_markerTables[orbit][t]->operator[](old).clear();
} }
// ref the new emb // ref the new emb
if (emb != EMBNULL) if (emb != EMBNULL)
......
...@@ -106,22 +106,35 @@ SimpleGlutWin::SimpleGlutWin(int* argc, char **argv, int winX, int winY) ...@@ -106,22 +106,35 @@ SimpleGlutWin::SimpleGlutWin(int* argc, char **argv, int winX, int winY)
glEnable(GL_LIGHT0); glEnable(GL_LIGHT0);
//Store context infos //Store context infos
#ifdef WIN32
m_drawable = wglGetCurrentDC();
m_context = wglGetCurrentContext();
#else
m_dpy = glXGetCurrentDisplay(); m_dpy = glXGetCurrentDisplay();
m_drawable = glXGetCurrentDrawable(); m_drawable = glXGetCurrentDrawable();
m_context = glXGetCurrentContext(); m_context = glXGetCurrentContext();
#endif
// Call other initialization (possibly overloaded in instances) // Call other initialization (possibly overloaded in instances)
instance->init(); instance->init();
} }
void SimpleGlutWin::releaseContext() void SimpleGlutWin::releaseContext()
{ {
glXMakeCurrent(m_dpy,None,NULL); #ifdef WIN32
wglMakeCurrent(NULL,NULL);
#else
glxMakeCurrent(m_dpy,None,NULL);
#endif
} }
void SimpleGlutWin::useContext() void SimpleGlutWin::useContext()
{ {
glXMakeCurrent(m_dpy, m_drawable, m_context); #ifdef WIN32
wglMakeCurrent(m_drawable, m_context);
#else
glxMakeCurrent(m_dpy, m_drawable, m_context);
#endif
} }
......
...@@ -155,7 +155,7 @@ VBO_Node::VBO_Node(Algo::Render::VBO::MapRender_VBO* vbo) ...@@ -155,7 +155,7 @@ VBO_Node::VBO_Node(Algo::Render::VBO::MapRender_VBO* vbo)
{} {}
void VBO_Node::VBO_Node::setVBO(Algo::Render::VBO::MapRender_VBO* vbo) void VBO_Node::setVBO(Algo::Render::VBO::MapRender_VBO* vbo)
{ {
m_vbo = vbo; m_vbo = vbo;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment