compile-file
command:
(compile-file "somepath/yourlispfile.lsp")Make sure to open the console window before compilation (
View/Console
)
because you will find diagnostic information there. The resulting DLL
will be generated in the current directory.
In order to use compile-file
, you must install the Integration Kit
beforehand. This is a separate option in the installation program;
use custom installation mode to select this option. You will also need
an Integration Kit license for the compiler.
Under the hood, the Lisp compiler uses Microsoft's Visual C++
to create the object code. Therefore, you must make sure to
install the right version of Visual C++ on your system
before running the Lisp compiler. The Integration Kit documentation
will tell you which version is required. (For OneSpace Modeling 2004, you'll need
VC++ 6.0, and OneSpace Modeling 2005 requires VS.NET 2003.)
Under HP-UX, HP's aCC
compiler is required.
compile-file
:
(compile-file "irgendeinpfad/lispdatei.lsp")Vorher sollte man das Konsolenfenster geöffnet haben (
Ansicht/Konsole
),
weil dort wichtige Diagnosemeldungen ausgegeben werden. Die erzeugte DLL
findet man dann im aktuellen Verzeichnis.
Um compile-file
benutzen zu können, muß man vorher das
Integration Kit installieren. Das ist eine eigene Option im Installationsprogramm
von OneSpace Modeling; man wähle eine benutzerangepaßte Installation und dann darin
die Option für das Integration Kit. Außerdem braucht man für den
Compiler auch eine Integration-Kit-Lizenz.
Intern verwendet der Lisp-Compiler Microsoft Visual C++, um den Objektcode
zu erzeugen. Daher muß man die passende Version von Visual C++
installieren, bevor man den Lisp-Compiler benutzen kann. Die Dokumentation
zum Integration Kit gibt die jeweils benötigte Version des C++-Compilers
an. (Bei OneSpace Modeling 2004 braucht man VC++ 6, und für OneSpace Modeling 2005 wird
VS.NET 2003 benötigt.)
Unter HP-UX wird der Compiler aCC
von HP verwendet.
-- ClausBrod - 23 Dec 2004
load
command:
(load "somepath/compiledlispfile")If a file called
compiledlispfile.dll
(HP-UX: compiledlispfile.so
)
is in the specified path, this will load it.
load
:
(load "irgendeinpfad/compiledlispfile")Wenn es eine Datei namens
compiledlispfile.dll
(HP-UX: compiledlispfile.so
)
im angegebenen Pfad gibt, wird sie hiermit geladen.
-- ClausBrod - 23 Dec 2004
compile-file
fails, and I get a strange Lisp error message LISP error: (SYSTEM ("SDLCPAS3" "-" "c:\\temp" -o" ...)) returned a non-zero value 3.If you see this ultra-cryptic error message, it means that compilation of the Lisp code has failed. As a first step to find out what is happening, open the console window (
View/Console
), then try to compile the Lisp file again. You will sometimes
get more informative error output in the console window. The most frequent problems are:
To compile Lisp code into a DLL, a C++ compiler is required.
OneSpace Modeling assumes that a copy of Visual C++ is installed on the
system, and that the compiler and linker can be executed
by calling the executables cl.exe
and link.exe
, respectively.
OneSpace Modeling runs those programs via the system command shell; in order
to find the programs, the command shell searches all directories
which are specified in the PATH
environment variable. If
cl.exe
and link.exe
cannot be found in any of the directories
in PATH
, compilation will fail.
Sometimes, Visual C++ does not add the required directories
to PATH
during installation, or does so only for the user
who installs the software, but not for any other users of the system.
Even worse, not only the PATH
environment variable, but also the
LIB
and INCLUDE
environment variables must be set correctly
during Visual C++ installation.
The easiest fix for this is to reinstall Visual C++ on the system, and making sure that it adds itself to the environment variables for the user(s) who later want to compile Lisp code.
Lisp compilation will only work reliably with the version of Visual C++ which is specified in the Integration Kit documentation. The table below lists OneSpace Modeling versions and corresponding versions of Visual C++.
OneSpace Modeling version | Visual Studio |
---|---|
2004 | Visual C++ 6.0 |
2005 | VS.NET 2003 |
2006/v14.0x for 32-bit systems | VS.NET 2003 |
2006/v14.0x for 64-bit systems | Visual Studio 2005 |
2006/v14.50 for 32-bit and 64-bit systems | Visual Studio 2005 |
Error code | What it means | What you can do about it |
---|---|---|
1 | Script called with wrong arguments. | Check parameters to the compile-file command |
2 | Clsp file not found (error in compiler front-end) | |
3 | C++ compilation error | Check settings for environment variables, see below |
4 | Linker error | Check correct compiler/linker installation |
5 | C++ compiler version on the system is not supported. | Check correct compiler/linker installation |
PATH
environment variable does not include references to the compiler installation
directories.
If the compiler is found, it will report its version and display usage information:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ]The above is the expected output for VS.NET 2003, which is required to compile Lisp files for OneSpace Modeling 2005. Now check if the environment variables
PATH
, INCLUDE
and LIB
are set
correctly. Open a DOS shell window and check those environment variables.
The following captures a DOS shell session on my system (where VS.NET 2003
is installed):
c:\temp>echo %INCLUDE% C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Include; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\ATLMFC\Include; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include c:\temp>echo %LIB% C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Lib; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\ATLMFC\Lib; C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib c:\temp>path PATH=....someotherdirectories... c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE; c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools; c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\Bin; c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Bin; c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin;-- ClausBrod, last updated 2006/11/27
*.lsp
file first, then re-compile.
compile-file
command:
(compile-file "c:/temp/foobar.lsp") ;; OK (cd "c:/temp")(compile-file "foobar.lsp") ;; OK (compile-file "c:\\temp\\foobar.lsp") ;; won't work
Foobar.lsp
übersetzt, kann daraus je nach Samba-Konfiguration foobar.dll
werden.
compile-file
darf man kein
Backslash-Zeichen verwenden:
(compile-file "c:/temp/foobar.lsp") ;; OK (cd "c:/temp")(compile-file "foobar.lsp") ;; OK (compile-file "c:\\temp\\foobar.lsp") ;; führt zu Ladefehler-- ClausBrod (with contribution from JohnVanDoorn) - 11 February 2005