Troubleshooting

This page provides information on problems that might occur when trying to run / compile MIDACO.

For general questions, see the FAQ page.

 

 

MIDACO returns some IFLAG Error Message ?

See here for a detailed list of IFLAG-Messages.

Can't open MIDACO_SOLUTION.TXT file during runtime ?

Windows user may experience the problem that the text output files MIDACO_SCREEN.TXT, MIDACO_SOLUTION.TXT or MIDACO_HISTORY.TXT are blocked from access (by Windows file management) during MIDACO runtime. A simple workaround is to create a copy of those files and open the copy instead.

Problem with displaying 'MIDACO_SCREEN.TXT' and 'MIDACO_SOLUTION.TXT'

In some cases (e.g. Matlab-Windows), the files 'MIDACO_SCREEN.TXT' and 'MIDACO_SOLUTION.TXT' are not displayed correctly with a simple editor (e.g. Notepad). Open the txt-files with another editor (e.g. Notepad++ or the Matlab Editor) to avoid this problem.

 

General Error:  Segmentation fault (core dumped)

 

This problem can likely be fixed by increasing the stack size. In Linux this can be done by the command:

 

ulimit -s unlimited

 

This problem may occur, if the array size of RW or PF is too large or if the the problem dimension is very large (in esp. large-scale problems). This problem may also occur when executing MIDACO in parallel (e.g. openMP and MPI).

 

Matlab Error:   No C/C++ compiler found for MEX 

In some cases (in esp. Windows 64bit), Matlab does not provide a default C/C++ MEX compiler. In such case, the compiler must be installed manually by the user. One possible solution is to use the following free C/C++ compiler (64bit) distributed by Microsoft:

Microsoft Visual C++ 2010 Redistributable Package (x64)

Download and install above package. Then reboot your computer and start a fresh Matlab session. The type "mex -setup" in the command window. If above installation of the C/C++ compiler was successful, Matlab will automatically recognize the compiler and give the user some compiler option menu to choose from. Note that any supported mex compiler that is supported by Matlab can be used with MIDACO. Further reading: Matlab Search: mex compiler

Matlab Error:   ??? Undefined function or method 'midaco'...

To avoid this error, download "midaco.m" and include it in the Matlab path.

Matlab Error:   ??? Undefined function or method 'midacox'...

This error means, that Matlab did not found the MIDACO mex file. To avoid this error, download the C/C++ source code file "midacox.c" and generate the mex file from it (include the file in the Matlab path and type "mex midacox.c" and press Enter). Then make sure, that the generated mex file (e.g. "midacox.dll", "midacox.mexw32" or "midacox.mexglx") is included in the Matlab path.

C/C++ Error:   undefined reference to 'sqrt' 

This error (along with 'undefined reference to 'pow' and 'undefined reference to 'floor') occurs when compiling with gcc and the math library was not linked to the objectives. To solve this problem, add the flag "-lm" at the very end of the linkage command. For example: gcc -o example.o midaco.o -lm 

C/C++ Error:   'x' was not declared in this scope 

This error (along with 'expected ',' or ';' before 'doublereal' and 'expected unqualified-id before '{' token') occurs when trying to compile 'midaco.c' with g++. The 'midaco.c' file does not compile with g++. However, all MIDACO example files can be compiled with g++ (see this makefile). Compiling 'midaco.c' with gcc (or another c-compiler) fixes this issue. 

Note that this error may also occurs, when compiling 'midaco.c' in MS Visual Studio with pre-compiled headers.

C/C++ Error:   LNK2019 (MS Visual Studio)

In case the following error appears when building a MS Visual Studio solution:

LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

 

it can be easily fixed by changing VS: Properties -> Linker -> System -> SubSystem from Windows to Console

 

(/SUBSYSTEM:WINDOWS)   >>>---change---to--->>>    (/SUBSYSTEM:CONSOLE)

 

C/C++ Error:   fopen (MS Visual Studio)

Some MS Visual Studio versions treat the  fopen  command as error and expect  fopen_s instead. A small modification in the  midaco.c   source code is then required to compile MIDACO in MS Visual Studio. In the   midaco.c   file,   change the   fopen   command to   fopen_s  by commenting out line 5002 and enabling line 5003 instead. The result should look like following:

 

Makefile Error:   *** No targets specified and no makefile found 

When downloading the 'Makefile', most web-browsers automatically add the extension ".txt" to the Makefile. Renaming "Makefile.txt" to "Makefile" on your system should solve this problem.

Python Error:   WindowsError: [Error 193] %1 is not a valid Win32 application

This error occurs when a 64bit DLL file is used with a 32bit Python installation. In order to fix this error, use the 32bit "midacopy.dll" library file instead of the 64bit one.

Python Error:   wrong ELF class: ELFCLASS32

To fix this error, use the 32bit library version, instead of the 64bit one.

Python Error:   ValueError: Can only assign sequence of same size

This error occurs, when the problem dimension declaration of the number of objectives does not agree with the return argument dimension of array containing the objectives in the problem_function subroutine. To fix this error, ensure that the number of objectives (and constraints) is set correctly in both: the main file and the problem function subroutine. (Note that for unconstrained problems, the "g" array is a dummy argument of size one)

Octave Error:   'matlabpool' undefined

MIDACO uses the 'parfor' approach for parallelization under Matlab. This feature is unfortunately currently not (yet) available in Octave.

 

Fortran Error:   Compiling with Silverfrost FTN95 

When compiling MIDACO with Silverfrost FTN95 some minor modifications regarding the printing must be done  to the "midaco.f" file. This is commenting or deleting the "FLUSH( IOUT )" command at the very bottom of the "midaco.f" file and changing all screen printing units from 0 to 5.

For example, change:

CALL PRINT_LINE(EVAL,TNOW,BESTF,BESTR,0)

to

CALL PRINT_LINE(EVAL,TNOW,BESTF,BESTR,5)

Fortran Error:   Unknown IFLAG values

Fortran can be nasty. If multi-objective problems are solved and the pre-allocated array size of F() is too small, you might receive unknown IFLAG values or other strange reports. To fix those issues, ensure that all pre-allocated arrays are sufficiently large.

Julia Error:   LoadError: error compiling midacoLIB: could not load library

This error occurs, when the path to the MIDACO library file (midacoJL.dll) is not set correctly. To fix this error, open midaco.jl with a text editor, got to end of the file and manually enter the path where midacoJL.dll is stored.

 

Java Error:   UnsatisfiedLinkError : Midaco.runmidaco(IIIIIII[D[D[D[D...

 

This error indicates that the path to the MIDACO library file "midacoj.dll" is not working correctly. To fix this error, enter the path manually at the end of the "Midaco.java" file. An example path on Windows to the Desktop looks as following:

 

     static{ try { System.load("C:\\Users\\username\\Desktop\\midacoj.dll"); }
                   catch (UnsatisfiedLinkError e) {} }

 

 

END OF FAQ

If you experience a problem, that is not listed here, please feel free to contact us.