mirror of https://github.com/CGAL/cgal
lapack support
This commit is contained in:
parent
fce122d046
commit
a05f910ea9
|
|
@ -1 +1,2 @@
|
||||||
clean_tree.csh
|
clean_tree.csh
|
||||||
|
demo
|
||||||
|
|
|
||||||
|
|
@ -55,5 +55,5 @@ int main(int argc, char *argv[])
|
||||||
std::cout << monge_fit.pca_basis(i).first << std::endl
|
std::cout << monge_fit.pca_basis(i).first << std::endl
|
||||||
<< monge_fit.pca_basis(i).second << std::endl;
|
<< monge_fit.pca_basis(i).second << std::endl;
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,27 +10,15 @@ include $(CGAL_MAKEFILE)
|
||||||
#---------------------------------------------------------------------#
|
#---------------------------------------------------------------------#
|
||||||
# compiler flags
|
# compiler flags
|
||||||
#---------------------------------------------------------------------#
|
#---------------------------------------------------------------------#
|
||||||
LAPACK_INCDIRS = -I$(LAPACK_DIR)/SRC -I$(LAPACK_DIR)
|
#LAPACK_INCDIRS = -I$(LAPACK_DIR)/SRC -I$(LAPACK_DIR)
|
||||||
|
|
||||||
CXXFLAGS = -I../../include \
|
CXXFLAGS = -I../../include \
|
||||||
$(CGAL_CXXFLAGS) \
|
$(CGAL_CXXFLAGS) \
|
||||||
$(LONG_NAME_PROBLEM_CXXFLAGS) \
|
$(LONG_NAME_PROBLEM_CXXFLAGS)
|
||||||
$(LAPACK_INCDIRS)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
#---------------------------------------------------------------------#
|
||||||
# linker flags
|
# linker flags
|
||||||
#---------------------------------------------------------------------#
|
#---------------------------------------------------------------------#
|
||||||
#this gives linking problems?? so i use the other
|
|
||||||
# LAPACK_LDLIBS = -L$(LAPACK_DIR) -L$(LAPACK_DIR)/F2CLIBS \
|
|
||||||
# -llapack_LINUX \
|
|
||||||
# -lblas_LINUX -ltmglib_LINUX \
|
|
||||||
# -lF77 -lI77 -lm -lc
|
|
||||||
|
|
||||||
F2CDIR = $(LAPACK_DIR)/F2CLIBS
|
|
||||||
LAPACK_LDLIBS = $(LAPACK_DIR)/lapack_LINUX.a \
|
|
||||||
$(LAPACK_DIR)/blas_LINUX.a \
|
|
||||||
$(F2CDIR)/libF77.a $(F2CDIR)/libI77.a -lm -lc
|
|
||||||
|
|
||||||
LIBPATH = \
|
LIBPATH = \
|
||||||
$(CGAL_LIBPATH)
|
$(CGAL_LIBPATH)
|
||||||
|
|
||||||
|
|
@ -69,17 +57,3 @@ depend:
|
||||||
.cpp$(OBJ_EXT):
|
.cpp$(OBJ_EXT):
|
||||||
$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<
|
$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<
|
||||||
|
|
||||||
# DO NOT DELETE
|
|
||||||
|
|
||||||
PolyhedralSurf.o: /usr/include/stdlib.h /usr/include/sys/cdefs.h
|
|
||||||
PolyhedralSurf.o: /usr/include/_types.h /usr/include/sys/_types.h
|
|
||||||
PolyhedralSurf.o: /usr/include/machine/_types.h /usr/include/i386/_types.h
|
|
||||||
PolyhedralSurf.o: /usr/include/sys/wait.h /usr/include/sys/signal.h
|
|
||||||
PolyhedralSurf.o: /usr/include/sys/appleapiopts.h
|
|
||||||
PolyhedralSurf.o: /usr/include/machine/signal.h /usr/include/i386/signal.h
|
|
||||||
PolyhedralSurf.o: /usr/include/sys/resource.h /usr/include/machine/endian.h
|
|
||||||
PolyhedralSurf.o: /usr/include/i386/endian.h /usr/include/sys/_endian.h
|
|
||||||
PolyhedralSurf.o: /usr/include/stdint.h /usr/include/libkern/OSByteOrder.h
|
|
||||||
PolyhedralSurf.o: /usr/include/libkern/i386/OSByteOrder.h
|
|
||||||
PolyhedralSurf.o: /usr/include/alloca.h /usr/include/machine/types.h
|
|
||||||
PolyhedralSurf.o: /usr/include/i386/types.h /usr/include/stdio.h
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,16 @@
|
||||||
#ifndef CGAL_LAPACK_H
|
#ifndef CGAL_LAPACK_H
|
||||||
#define CGAL_LAPACK_H
|
#define CGAL_LAPACK_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
#ifdef CGAL_USE_F2C
|
||||||
#include "blaswrap.h"
|
#define my_dgelss dgelss_
|
||||||
#include "f2c.h"
|
#else my_dgelss dgelss
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "clapack.h"
|
int my_dgelss(int *m, int *n, int *nrhs,
|
||||||
|
double *a, int *lda, double *b, int *ldb, double *
|
||||||
|
s, double *rcond, int *rank, double *work, int *lwork,
|
||||||
|
int *info);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -78,7 +83,7 @@ public:
|
||||||
|
|
||||||
Lapack_svd::FT Lapack_svd::solve(Matrix& M, Vector& B)
|
Lapack_svd::FT Lapack_svd::solve(Matrix& M, Vector& B)
|
||||||
{
|
{
|
||||||
integer m = M.number_of_rows(),
|
int m = M.number_of_rows(),
|
||||||
n = M.number_of_columns(),
|
n = M.number_of_columns(),
|
||||||
nrhs = 1,
|
nrhs = 1,
|
||||||
lda = m,
|
lda = m,
|
||||||
|
|
@ -92,7 +97,7 @@ public:
|
||||||
|
|
||||||
FT rcond = -1;
|
FT rcond = -1;
|
||||||
|
|
||||||
dgelss_(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values,
|
my_dgelss(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values,
|
||||||
&rcond, &rank, work, &lwork, &info);
|
&rcond, &rank, work, &lwork, &info);
|
||||||
assert(info==0);
|
assert(info==0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
# Created by the script create_makefile
|
|
||||||
# This is the makefile for compiling a CGAL application.
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# include platform specific settings
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# Choose the right include file from the <cgalroot>/make directory.
|
|
||||||
|
|
||||||
include $(CGAL_MAKEFILE)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# compiler flags
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
LAPACK_INCDIRS = -I$(LAPACK_DIR)/SRC -I$(LAPACK_DIR)
|
|
||||||
|
|
||||||
CXXFLAGS = \
|
|
||||||
-I../../include \
|
|
||||||
$(CGAL_CXXFLAGS) \
|
|
||||||
$(LONG_NAME_PROBLEM_CXXFLAGS) \
|
|
||||||
$(LAPACK_INCDIRS)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# linker flags
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
F2CDIR = $(LAPACK_DIR)/F2CLIBS
|
|
||||||
LAPACK_LDLIBS = $(LAPACK_DIR)/lapack_LINUX.a \
|
|
||||||
$(LAPACK_DIR)/blas_LINUX.a \
|
|
||||||
$(F2CDIR)/libF77.a $(F2CDIR)/libI77.a -lm -lc
|
|
||||||
|
|
||||||
LIBPATH = \
|
|
||||||
$(CGAL_LIBPATH)
|
|
||||||
|
|
||||||
LDFLAGS = \
|
|
||||||
$(LONG_NAME_PROBLEM_LDFLAGS) \
|
|
||||||
${LAPACK_LDLIBS} \
|
|
||||||
$(CGAL_LDFLAGS) \
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# target entries
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
|
|
||||||
all: \
|
|
||||||
blind_1pt$(EXE_EXT)
|
|
||||||
|
|
||||||
blind_1pt$(EXE_EXT) : blind_1pt$(OBJ_EXT)
|
|
||||||
$(CGAL_CXX) $(LIBPATH) -o blind_1pt blind_1pt$(OBJ_EXT) \
|
|
||||||
$(LDFLAGS)
|
|
||||||
|
|
||||||
clean: \
|
|
||||||
blind_1pt.clean
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
depend:
|
|
||||||
makedepend *.[Ch]
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
# suffix rules
|
|
||||||
#---------------------------------------------------------------------#
|
|
||||||
|
|
||||||
.C$(OBJ_EXT):
|
|
||||||
$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<
|
|
||||||
|
|
||||||
# DO NOT DELETE
|
|
||||||
|
|
||||||
blind_1pt.o: /usr/include/stdio.h /usr/include/_types.h
|
|
||||||
blind_1pt.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h
|
|
||||||
blind_1pt.o: /usr/include/machine/_types.h /usr/include/i386/_types.h
|
|
||||||
blind_1pt.o: /usr/include/stdlib.h /usr/include/sys/wait.h
|
|
||||||
blind_1pt.o: /usr/include/sys/signal.h /usr/include/sys/appleapiopts.h
|
|
||||||
blind_1pt.o: /usr/include/machine/signal.h /usr/include/i386/signal.h
|
|
||||||
blind_1pt.o: /usr/include/sys/resource.h /usr/include/machine/endian.h
|
|
||||||
blind_1pt.o: /usr/include/i386/endian.h /usr/include/sys/_endian.h
|
|
||||||
blind_1pt.o: /usr/include/stdint.h /usr/include/libkern/OSByteOrder.h
|
|
||||||
blind_1pt.o: /usr/include/libkern/i386/OSByteOrder.h /usr/include/alloca.h
|
|
||||||
blind_1pt.o: /usr/include/machine/types.h /usr/include/i386/types.h
|
|
||||||
Loading…
Reference in New Issue