Great project! I have used it to add rational (mpq) and variable
precision floating point (mpf) datatypes to my APL interpreter. Many
thanks for all of your hard work.
Running MPIR-2.5.0 on a Win7/AMD64 system, I need to create static
libraries for 32- and 64-bit builds as well as debug and non-debug versions.
1. In order to create both 32- and 64-bit versions on the same Windows
platform, it's necessary to set the environment variable
PROCESSOR_ARCHITECTURE for each context. Also, the resulting library
must be renamed to avoid it being clobbered by the other ABI.
I created the following batch files in the /mpir-2.5.0/win/ directory:
mk32.bat:
=========
setlocal
Set PROCESSOR_ARCHITECTURE=x86
call make clean
call configure ABI=32
if errorlevel 1 goto :EXIT
call make
if errorlevel 1 goto :EXIT
if not exist ..\lib mkdir ..\lib
copy mpir.lib ..\lib\mpir32.lib
:EXIT
endlocal
========
mk64.bat:
=========
setlocal
Set PROCESSOR_ARCHITECTURE=AMD64
call make clean
call configure ABI=64
if errorlevel 1 goto :EXIT
call make
if errorlevel 1 goto :EXIT
if not exist ..\lib mkdir ..\lib
copy mpir.lib ..\lib\mpir64.lib
:EXIT
endlocal
========
There are many ways to write these batch files.
2. The second goal of enabling DEBUG vs. non-DEBUG involves changes to
configure.bat -- my take on it is as follows:
Insert the following lines
if "%0" == "--debug" (
shift
set DFLAGS=/Z7 /D "DEBUG"
set DFLAGS1=/MTd
) else (
set DFLAGS=/Ox /Ot /Oi /D "NDEBUG"
set DFLAGS1=/MT
)
after label :lp.
Replace the following lines
echo (set FLAGS=/Ox /Ot /D "NDEBUG" /D "HAVE_CONFIG_H" /nologo /D
"_MBCS" /GS-) >> config.params.bat
if %LIBTYPE% == lib (set FLAGS1=/Oi /D "_LIB" /D "PIC" /MT)
with
echo (set FLAGS=%DFLAGS% /D "HAVE_CONFIG_H" /nologo /D "_MBCS" /GS-) >>
config.params.bat
if %LIBTYPE% == lib (set FLAGS1=/D "_LIB" /D "PIC" %DFLAGS1%)
I'm not sure what debug flags to use for DLLs so I made no change to
that portion.
This change involves creating two more batch files, the 32-bit version
of which is
mk32d.bat
=========
@echo off
setlocal
Set PROCESSOR_ARCHITECTURE=x86
call make clean
call configure ABI=32 --debug
if errorlevel 1 goto :EXIT
call make
if errorlevel 1 goto :EXIT
if not exist ..\lib mkdir ..\lib
copy mpir.lib ..\lib\mpir32d.lib
:EXIT
endlocal
========
3. BTW, when I compile the 64-bit version (but not the 32-bit version),
the compile ends with
osmpq.cc
osmpz.cc
divexact_by3c.obj : warning LNK4006: __gmpn_divexact_by3 already defined
in compat.obj; second definition ignored
This is probably harmless, but is there some way to avoid it?
--
_______________________________________________________________
Bob Smith - bsm...@sudleyplace.com
http://www.sudleyplace.com - http://www.nars2000.org
--
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en.