Skip to content
Snippets Groups Projects
Commit ebd7850f authored by Brad Barber's avatar Brad Barber
Browse files

Fix so files for libqhull and libqhull-p

Fix shadowed variable 'facets'
Fix gitignore for sln/vcproj
parent 0f998af1
No related branches found
No related tags found
No related merge requests found
......@@ -20,12 +20,14 @@ r?
bin/*
lib/*
tmp/*
build/*
*.a
*.dll
*.lib
*.exe
*.o
*.md5sum
src/road/RoadTest.h.cpp
# Out-of-date directories
config/*
......@@ -44,6 +46,8 @@ working/*/*
*.suo
*.user
*.ilk
!build/*.sln
!build/*/*.vcproj
# CVS files
CVS/*
......
......@@ -74,12 +74,13 @@ PRINTC = enscript -2r
# -fno-strict-aliasing not needed for gcc 4.4+ (segfault in qset.c)
#for CXX_OPTS1, libqhullcpp must be before libqhull
CC = gcc
CC_OPTS1 = -O2 -ansi -fno-strict-aliasing -Isrc/libqhull $(CC_WARNINGS)
CC_OPTS1 = -O2 -fPIC -ansi -fno-strict-aliasing -Isrc/libqhull $(CC_WARNINGS)
CXX = g++
CXX_OPTS1 = -O2 -Dqh_QHpointer -Isrc/ -Isrc/libqhullcpp -Isrc/libqhull $(CXX_WARNINGS)
SO = so # Extension for shared libraries
CC_OPTS3 =
SO = so.5.1
# On MinGW,
# SO= dll # make SO=dll
# SO = 5.1.dll
# CC_OPTS3= -Wl,-s -Wl,--out-implib,bin/libqhull.a -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
# for Sun's cc compiler, -fast or O2 for optimization, -g for debugging, -Xc for ANSI
......@@ -114,9 +115,12 @@ CXX_WARNINGS = -Wall -Wcast-qual -Wextra -Wwrite-strings -Wno-sign-conversion -W
# Default targets for make
all: bin/rbox bin/qconvex bin/qdelaunay bin/qhalf bin/qvoronoi bin/qhull qtest \
bin/user_eg bin/user_eg2 bin/user_eg3 bin/qhull-p.$(SO) qhull-prompt
all: bin-lib bin/rbox bin/qconvex bin/qdelaunay bin/qhalf bin/qvoronoi bin/qhull qtest \
bin/user_eg bin/user_eg3 bin/user_eg2 bin/qhull-p.$(SO) qhull-prompt
bin-lib:
mkdir -p bin lib
# LIBQHULL_OBJS ordered by frequency of execution with small files at end. Better locality.
L= src/libqhull
......@@ -405,6 +409,7 @@ clean:
rm -f src/libqhullstatic/*.o src/libqhullstaticp/*.o src/qconvex/*.o
rm -f src/qdelaunay/*.o src/qhalf/*.o src/qvoronoi/*.o src/qhull/*.o src/rbox/*.o
rm -f src/road/*.o src/user_eg/*.o src/user_eg2/*.o src/user_eg3/*.o
rm -f src/road/RoadTest.h.cpp
cleanall: clean
rm -f bin/qconvex bin/qdelaunay bin/qhalf bin/qvoronoi bin/qhull bin/*.exe
......@@ -452,11 +457,13 @@ lib/libqhullstatic-p.a: $(LIBQHULLP_OBJS)
ar -rs $@ $^
#ranlib $@
bin/qhull.$(SO): $(LIBQHULL_OBJS)
bin/libqhull.$(SO): $(LIBQHULL_OBJS)
$(CC) -shared -o $@ $(CC_OPTS2) $^
ln $@ bin/libqhull.so
bin/qhull-p.$(SO): $(LIBQHULLP_OBJS)
bin/libqhull-p.$(SO): $(LIBQHULLP_OBJS)
$(CC) -shared -o $@ $(CC_OPTS2) $^
ln $@ bin/libqhull-p.so
lib/libqhullcpp.a: $(LIBQHULLCPP_OBJS)
ar -rs $@ $^
......@@ -485,7 +492,8 @@ bin/rbox: src/rbox/rbox.o lib/libqhullstatic.a
bin/user_eg: src/user_eg/user_eg.o lib/libqhullstatic.a
$(CC) -o $@ $< $(CC_OPTS2) -Llib -lqhullstatic -lm
bin/user_eg2: src/user_eg2/user_eg2.o bin/qhull.$(SO)
bin/user_eg2: src/user_eg2/user_eg2.o bin/libqhull.$(SO)
echo -e '\n== If user_eg2 fails to link, switch to -lqhullstatic.\n== On MinGW/Cygwin, use "make SO=dll"'
$(CC) -o $@ $< $(CC_OPTS2) -Lbin -lqhull -lm
bin/user_eg3: src/user_eg3/user_eg3.o lib/libqhullstatic-p.a lib/libqhullcpp.a
......
......@@ -61,7 +61,7 @@ To do
gitorious.org/qhull 2011/03/27
- Fixed QhullFacet::PrintRidges to check hasNextRidge3d()
- Cleaned up project files
- Fixed Makefile for shared libraries
- Fixed Makefile for shared libraries, but does not work on all platforms
- Moved libqhull to libqhullstatic, as done in CMakeLists
- Made libqhull a shared library
The msvc build does not generate a valid dll
......
......@@ -24,12 +24,14 @@ SUBDIRS += qhalf
SUBDIRS += qvoronoi
SUBDIRS += rbox
SUBDIRS += user_eg #user program linked to libqhullstatic
SUBDIRS += user_eg2 #user program linked to libqhull
SUBDIRS += libqhullcpp #static library for C++ interface to libqhullstaticp
SUBDIRS += user_eg3 #user program with libqhullcpp and libqhullstaticp
SUBDIRS += qhulltest #test program with Qt, libqhullcpp, and libqhullstaticp
# user_eg2 does not link in DevStudio 2005 -lqhull not found
SUBDIRS += user_eg2 #user program linked to libqhull
OTHER_FILES += CMakeLists.txt
OTHER_FILES += Make-config.sh
OTHER_FILES += ../Announce.txt
......
......@@ -65,7 +65,7 @@ int main(int argc, char **argv) {
int user_eg3(int argc, char **argv)
{
bool facets= false;
bool printFacets= false;
if(strcmp(argv[1], "eg-100")==0){
RboxPoints rbox;
rbox.appendPoints("100");
......@@ -98,7 +98,7 @@ int user_eg3(int argc, char **argv)
qhull.setOutputStream(&cout);
}
}else if(strcmp(argv[i], "facets")==0){
facets= true;
printFacets= true;
}else if(readingRbox){
readingRbox++;
cerr << "rbox " << argv[i] << endl;
......@@ -146,7 +146,7 @@ int user_eg3(int argc, char **argv)
if(qhull.useOutputStream){
return 0;
}
if(facets){
if(printFacets){
QhullFacetList facets= qhull.facetList();
cout << "\nFacets created by Qhull::runQhull()\n" << facets;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment