- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hello there, first sorry for my not perfect english. I have a serious problem with a complex software project. It was last build with Visual Fortran 6.0, using IMSL-library 2.0. I had to lift the environment to Intel Compiler witf Developer Studio 2008/ 2010. With some work, it seemed I got it running. But there is still a serious problem: The project uses an IMSL-routine names "DNCONG", that is not included any more in the new IMSL-library. I tried allready to link the old IMSL-library, but without success. I would be glad for any hints or suggestions how to solve this problem best. Maybe also with using an alternative IMSL-routine.
Gretings from Germany
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
As best as I can tell from a web search, DNCONG was a nonlinear solver. It was deprecated and removed from IMSL many years ago. IMSL has an assortment of other nonlinear solvers, as does the Intel Math Kernel Library that is included with Intel Visual Fortran. You can ask for suggestions in the Rogue Wave IMSL forum and in the Intel Math Kernel Library forum.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Current versions of IMSL-FNL provide NNLPG, which has the same functionality as NCONG, but with a slightly different argument list. MKL provides effective routines for nonlinear least squares without or with bound constraints, but none for general NLP problems.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks for the fast answers. While reading the IMSL-manuals (old and new) I found already the routine NNLPG, that seems to replace NCONG. But the parameters differs a lot, because I have to put all optional parameters to get FVALUE (which is the last Parameter). Another problem are the parameters FCN and GRAD (functions and gradients), because in NCONG was still the parameter N wich describes the dimension of the problem. For NNLPG this is not any more abvailable. The problem is, that the project solves two cases, one time with 3 variables, one time with 4 and for this the dimension must be known in FCN and GRAD. Other problem is, that the original software was written many years ago, the numerical solutions were used kinda "blackbox", enhancements were just done while programming "around" (for example modifying the starting vector that reflects the initial guess). For this reason its really difficult for me, to replace the function (and even it is used for 4 problems inside the whole project). Well, it seems what really would help is to find somebody that faced the same problem. Searching NCONG in net gives results, so it must be used often and I should not be alone. I will try also in Rogue Wave-forums, I searched there allready but seems an existing topic about NCONG does not exist. Exists maybe an older Forum from Visual Numerics (which was before the distributor of IMSL)? Again thanks and have a good time.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The problems that you describe are minor and easy to overcome.
- You can call routines in the old IMSL/CVF library from code compiled with the option /iface:cvf by IFort-32.
- You can define shared variables such as N and your "optional parameters" in a module, and USE that module in FCN and GRAD.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks again for your answer, and good tipp with the shared variables. Would be a solution. In the moment more interesting sounds for me to use the old IMSL lib from Compaq Visual Fortran, this would be really great for the first step! (I would gain much time for changing the code for the future to use new IMSL). I tried the option /iface:cvf and tried to link the old IMSL, but I got now some new unresolved externals: OtsMove, OtsMoveMinimum and some more. Any ideas how to solve this?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thank you really very, very much for this good instructions! It would be great, if I can get the old library to run. I built the lib and dll and used it and first success: no unresolved externals any more, project was built complete. Just something still is wrong, first call of an IMSL-routine ends in an endless loop it seems, program hangs and does not finish. It seems to happen with all IMSL-calls, as I call the first, program hangs. Maybe something wrong with calling settings?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I have tested the DLL and the import library with IFort 13.1 on about 145 of the examples in chapters 3, 4, 5, 7 and 8 of the IMSL4 Math library manual. Almost all of the example codes ran correctly. Please try one or two of those example codes on your system before attempting to run your own code..Once we work out the correct settings on your system for those examples, you could try the same settings on your code. If possible, please provide a short example code that you find to result in an endless loop.
Here, for example, is how I build the NCONG example given on pages 1006, 1007 of the IMSL 4 manual MATH.PDF, after building the DLL and library as described above and naming the import library as IMSLDLL.LIB.
With CVF:
[bash]s:\imsl\Chap8>df /libs:dll xnconf.f imsldll.lib[/bash]
With IFort:
[bash]S:\imsl\Chap8>ifort /iface:cvf xncong.f imsldll.lib[/bash]
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi, there must be something generally wrong, maybe I am too stupid at moment. Any IMSL-call causes a frozen programm, even in a test-programm. I tried the example from the old IMSL-manual for NCONG:
INTEGER IBTYPE, IPRINT, M, MAXITN, ME, N
PARAMETER (IBTYPE=0, IPRINT=0, M=2, MAXITN=100, ME=1, N=2)
C
REAL FVALUE, X(N), XGUESS(N), XLB(N), XUB(N)
EXTERNAL FCN, GRAD, NCONG, WRRRN
C
DATA XGUESS/2.0E0, 2.0E0/
DATA XLB/-1.0E6, -1.0E6/, XUB/1.0E6, 1.0E6/
C
CALL NCONG (FCN, GRAD, M, ME, N, XGUESS, IBTYPE, XLB, XUB,
+ IPRINT, MAXITN, X, FVALUE)
C
CALL WRRRN ('The solution is', N, 1, X, N, 0)
END
C
SUBROUTINE FCN (M, ME, N, X, ACTIVE, F, G)
INTEGER M, ME, N
REAL X(*), F, G(*)
LOGICAL ACTIVE(*)
C Himmelblau problem 1
F = (X(1)-2.0E0)**2 + (X(2)-1.0E0)**2
C
IF (ACTIVE(1)) G(1) = X(1) - 2.0E0*X(2) + 1.0E0
IF (ACTIVE(2)) G(2) = -(X(1)**2)/4.0E0 - X(2)**2 + 1.0E0
RETURN
END
C
SUBROUTINE GRAD (M, ME, MMAX, N, X, ACTIVE, F, G, DF, DG)
INTEGER M, ME, MMAX, N
REAL X(*), F, G(*), DF(*), DG(MMAX,*)
LOGICAL ACTIVE(*)
C
DF(1) = 2.0E0*(X(1)-2.0E0)
DF(2) = 2.0E0*(X(2)-1.0E0)
C
IF (ACTIVE(1)) THEN
DG(1,1) = 1.0E0
DG(1,2) = -2.0E0
END IF
C
IF (ACTIVE(2)) THEN
DG(2,1) = -0.5E0*X(1)
DG(2,2) = -2.0E0*X(2)
END IF
RETURN
END
I can put a breakpoint oin CALL NCONG, after entering it program hangs. Even if I disable NCONG and just want to enter WRRRN also program hangs. Same effect with my big program, every IMSL-call results in hanging prog.
In the example, onliest project-setting I changed was the "calling Convention" /iface:cvf, rest was default of a console-app from fortran13.
Well, the manual build IMSL.lib I just added to source files and the dll is in binary folder of the executable, should work also I think?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Same effect when I build "manual" with
ifort /iface:cvf ncong_ex.for imsl.lib
My exe was build, but when executing makes the same. Something wrong must be with the imsl.dll.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I ran your (IMSL's) example above in the VS12 debugger. It runs fine. I can step through the lines of code. Since the IMSL library is not debug-enabled, one cannot step into library routines such as NCONG in source mode. However, you can step through them in disassembly mode, and everything appears to be normal. The code runs and I can see the values of the variables get updated in the Locals pane.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi again, I got it running! It was really something wron with the imsl.dll. I am not an expert with libraries, but seems for me that must be some name conflicts? I renamed your def file in IMSL2.def and also the library output to IMSL2 and now it runs. Also the dll-size rised from 1,2 MB to 16 MB. My test-program now runs fine and I will try out my big prog. I will post if I am succesfull, but already now: thousand thanks, really! This gives me time to change DNCONG in NNLPG, cause there must many cases been tested and so on.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
[Edit: Your last post arrived after I posted the first version of this response]
Your DLL was not built properly, possibly due to a name clash (between the import library IMSL.LIB and the static library of the same name). Note that when you run LIB on the .DEF file an import library and an EXP file are output. That import library should be set aside before building the DLL. The IMSL.LIB used to build the DLL should be a static library -- the one provided with CVF. If you take note of these points and build the DLL, you should obtain a DLL that is over 17 MB long. The DLL that you posted above is less than 2 MB. Copyright restrictions do not allow me to post the DLL that I built.
P.S. Your last post appeared just now, so some of my statements simply repeat your findings. I am glad that you got things working. Good luck with your work!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Yes you are right, it was a name conflict! Again thanks and also keep up the good work.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
And also my big project works now fine with the the old libs. I got exact same results in first test-runs. Great!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Those routines come from the CVF runtime libraries DFORMT.LIB/DFORMD.LIB, etc.
If you take this deprecated route, watch out for the following problem: the CVF runtime libraries and the IFort runtime libraries may have some overlap. If an IMSL4 routine ends up calling an IFort I/O routine or your Fortran code ends up calling a CVF runtime routine, your code may crash. To avoid these problems, for the infrequent occasions when I want to call IMSL4 routines from IFort code, I have built a self-contained IMSL.DLL and an export library that exports only those IMSL symbols that will be called from user code. The attached Zip file contains the DEF file. It is best for you to build the DLL in a CVF command window as follows, after extracting the DEF file in a different directory than any of the CVF and IFort directories.
- lib /def:imsldll.def /machine:i386
- df /dll imsldll.exp imsl.lib imsls_err.lib imslmpistub.lib
Save the import library imsldll.lib and the DLL in some convenient location and use them with your IFort programs that need to use IMSL4 after adding the path to imsl.lib to LIB and the path to IMSL.DLL to PATH.
Please note that this entire procedure is deprecated, completely unsupported and to be undertaken at your risk.

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite