forum.alglib.net
http://forum.alglib.net/

Creating a library for ALGLIB
http://forum.alglib.net/viewtopic.php?f=2&t=1020
Page 1 of 1

Author:  Bengt [ Wed Oct 09, 2013 11:34 pm ]
Post subject:  Creating a library for ALGLIB

We are currently evaluating ALGLIB internally. We have some templated classes using the lsfit stuff.
However, when not compiling ALGLIB to a separate library, we have to include the source with any other project using
our templates. This is kinda annoying.

Is there an easy way to compile the ALGLIB code to a dynamic or static library with all the symbols exported?
We are using VS2012 currently.

Thanks!

Author:  path [ Thu Oct 10, 2013 12:34 am ]
Post subject:  Re: Creating a library for ALGLIB

I had the same problem and used the following Makefile to make a static library. Don't know how to do that with VC.

##Makefile
CC= g++
CFLAGS= -g -Wall -O2
LOBJS= alglibinterface.o alglibinternal.o alglibmisc.o ap.o dataanalysis.o diffequations.o fasttransforms.o integration.o interpolation.o linalg.o optimization.o solvers.o specialfunctions.o statistics.o

PROG= libalglib.a
INCLUDES= -I.
LIBPATH=

.SUFFIXES:.cpp .o

.cpp.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@

all:libalglib.a

lib:libalglib.a

libalglib.a:$(LOBJS)
$(AR) -csru $@ $(LOBJS)

clean:
rm -fr *.o *.a

Author:  Sergey.Bochkanov [ Thu Oct 10, 2013 1:22 pm ]
Post subject:  Re: Creating a library for ALGLIB

Commercial edition of 3.8.1 will be shipped with precompiled ALGLIB+MKL combination (static library). Just one .lib file and 12 .h files. We use following command line to generate 64-bit target:

Code:
cl /nologo /I. /DAE_OS=AE_WINDOWS /DAE_CPU=AE_INTEL /Ox /EHa /c *.cpp
lib /NOLOGO /MACHINE:X64 /OUT:alglib64_hpc.lib *.obj


Does it work for you?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/