open-discussion > Unable to build and generate new exe file
Showing 1-9 of 9 posts
Display:
Results per page:
Feb 28, 2020  05:02 PM | sujan dasmahapatra
Unable to build and generate new exe file
hi all.

I am trying to build the source using lazarus, but no new exe is being generated. here below is my command which I took from README.txt.

lazbuild --verbose-pkgsearch lazopenglcontext --verbose-pkgsearch pascalscript

But it is not generating the new exe, I tested it with a new icon for MRIcroGL which is remained unchanged. Please advise how can we do the build and create exe file.

Thanks a lot in advance.
Feb 28, 2020  05:02 PM | Chris Rorden
RE: Unable to build and generate new exe file
I would try compiling from the IDE. You really did not provide enough information for me to comment. I suggest you follow the intstructions for compiling from the web page
  https://github.com/rordenlab/MRIcroGL12
I assume since you are looking for an exe you are trying to build on Windows.
Mar 2, 2020  02:03 PM | sujan dasmahapatra
RE: Unable to build and generate new exe file
C:\MRIcroGL_BUILD\MRIcroGL\dcm2nii.pas(554,6) Error: (5000) Identifier not found "OpenURL"
dcm2nii.pas(579) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: C:\FPC\3.0.4\bin\i386-Win32\ppc386.exe returned an error exitcode
Error: (lazarus) Compile Project, Mode: Default, OS: win32, CPU: i386, Target: MRIcroGL.exe: stopped with exit code 1
Error: (lazbuild) failed compiling of project C:\MRIcroGL_BUILD\MRIcroGL\simplelaz.lpi

I am getting this error, it is looking like OpenURL is actually this URL
https://github.com/rordenlab/dcm2niix/re...

but when I am opening it it is opening. but when from within program it is not opening as it is throwing error and stop generating the EXE.


any help is highly appreciated.
Mar 2, 2020  02:03 PM | sujan dasmahapatra
RE: Unable to build and generate new exe file
C:\MRIcroGL_BUILD\MRIcroGL\dcm2nii.pas(554,6) Error: (5000) Identifier not found "OpenURL"
dcm2nii.pas(579) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: C:\FPC\3.0.4\bin\i386-Win32\ppc386.exe returned an error exitcode
Error: (lazarus) Compile Project, Mode: Default, OS: win32, CPU: i386, Target: MRIcroGL.exe: stopped with exit code 1
Error: (lazbuild) failed compiling of project C:\MRIcroGL_BUILD\MRIcroGL\simplelaz.lpi

This seems it is the link,  but why this is not opening I am not sure.
https://github.com/rordenlab/dcm2niix/re...


Any help is highly appreciated.
Mar 2, 2020  03:03 PM | Chris Rorden
RE: Unable to build and generate new exe file
When you run Lazarus, and choose the "About Lazarus" menu item, what version of Lazarus are you running? If it is less than 2.0.6, can you upgrade: 
  https://www.lazarus-ide.org
The OpenURL function should be supplied by lclintf
  https://wiki.freepascal.org/lclintf

Is there any reason you are compiling to 32-bit? I would certainly compile a 64-bit executable. Since all 64-bit computers support SSE and have more registers, you tend to get much better performance.
Mar 7, 2020  03:03 PM | sujan dasmahapatra
RE: Unable to build and generate new exe file
Dear Chris

The thing is lclintf is for UNIX, I tried with lazarus IDE, but it was failing. How can we do it in Windows.?
Mar 7, 2020  04:03 PM | Chris Rorden
RE: Unable to build and generate new exe file
I suspect you are using an obsolete version of Lazarus. Please use Lazarus 2.0.6. I just compiled the code on Windows, and if I right-click on the OpenURL function it opens the file in lazarus\lcl\lclintf.pas
  https://svn.freepascal.org/svn/lazarus/trunk/lcl/lclintf.pas
I used the version of MRIcroGL source code from here
  https://github.com/rordenlab/MRIcroGL12
I just downloaded and reinstalled Lazarus 2.0.6.

By the way, the latest commit does expect one feature (sort indicators) that is in the trunk version of Lazarus but not in the current stable release (2.0.6). If you want to compile on 2.0.6, just remove the comments ('//') at the beginning and end of this block. Alternatively, install the trunk version to enable this feature:

//{$ifndef windows} //next lines require trunk or Lazarus >= 2.0.8
for i := 0 to (ClusterView.ColumnCount -1) do begin
if (i = Column.Index) then continue;
ClusterView.Column.SortIndicator:= siNone;
end;
if isDescending then
ClusterView.Column[Column.Index].SortIndicator:= siDescending
else
ClusterView.Column[Column.Index].SortIndicator:= siAscending;
//{$endif}
Mar 19, 2020  02:03 AM | sujan dasmahapatra
RE: Unable to build and generate new exe file
I am still unable to build MRIcroGL version 1.2. I think the version I downloaded from

https://github.com/rordenlab/MRIcroGL12

It showing errors in #ifdef windows system

says duplicate identifier system not found. a number of other errors that unit SimdUtils, VectorMath etc are also not found.

How can I get rid of it. I am guessing this errors are due to, windows, as there is a lot of windows ifdef statement. Is this version is made for mac primarily.

where version 1.0 is perfectly working fine,. with this command.

lazbuild --add-package C:/MRIcroGL_BUILD/Python-for-Lazarus/python4lazarus/python4lazarus_package.lpk -B simplelaz.lpi


Please suggest Chris what can be done ?
Mar 19, 2020  10:03 AM | Chris Rorden
RE: Unable to build and generate new exe file
1. Please read my previous comment that if you compile using Lazarus 2.0.6 you must uncomment an IFDEF so the new SortIndicator is not used. If you want to use this feature, you must update to the developmental version of Lazarus (Trunk).


2. Please read the web page you linked: https://github.com/rordenlab/MRIcroGL12 - it notes that you must install the Metal-Demos repository and you will want to make sure your MRIcroGL project has this folder in its path (with MRIcroGL project open in Lazarus, choose Project/ProjectOptions/Paths and make sure the other unit files points to ../Metal-Demos/common;

3. Specifically for Windows you can adjust whether a faster static library is used. For example, I my have Project/ProjectOptions/Paths providing the link to ../static/x86_64-win64 which includes the faster static library from https://github.com/synopse/mORMot - but if you want to skip this just comment out the FastGZ directives in nifti.pas and mat.pas. You will be alerted of these options when you try to compile on Windows with your path not set correctly
 //Windows: if you get an error "Can't find object file" you can copy the 'static' folder from
// https://github.com/synopse/mORMot
//Alternatively, disable "FastGZ" in nifti.pas and umat.pas



I agree that MRIcroGL1.0 is easier to build, but that is because it is monolithic. In contract, MRIcroGL1.2 is modular and this allows you to compile to either OpenGL or Metal and also allows you to build simpler projects from scratch. For example, the volume rendering core is here
   https://github.com/neurolabusc/Metal-Demos/tree/master/volumerender