forum.alglib.net

ALGLIB forum
It is currently Sat Nov 30, 2024 2:51 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Creating a library for ALGLIB
PostPosted: Wed Oct 09, 2013 11:34 pm 
Offline

Joined: Wed Oct 09, 2013 11:30 pm
Posts: 1
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!


Top
 Profile  
 
 Post subject: Re: Creating a library for ALGLIB
PostPosted: Thu Oct 10, 2013 12:34 am 
Offline

Joined: Mon Sep 16, 2013 3:50 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Creating a library for ALGLIB
PostPosted: Thu Oct 10, 2013 1:22 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group