* * *

Author Topic: 64bit Development Environment Setup basics  (Read 3817 times)

TheRaven

  • Newbie
  • Posts: 4
64bit Development Environment Setup basics
« on: September 29, 2016, 09:50:41 am »
Developing 64bit Applications with FPC and Lazarus IDE, "FPC Lazarus 64bit Development Notes"
29-Sep-2016

The following instruction/methodology was performed and compiled using: Windows 10 Professional 64bit, lazarus-1.6.0-fpc-3.0.0-win64.exe Lazarus IDE 64bit and the fpc-3.0.0.i386-win32.cross.x86_64-win64.exe 32bit to 64bit cross compiler.


Purpose:
Provide step-wise instruction for obtaining, installing and configuring FPC and Lazarus IDE for developing 64bit Windows applications. Most threads and instruction discuss compiling the compiler and IDE from source or are inconclusive offering little help for developers trying to establish stable 64bit development environments. The following matter addresses installation semantics in a lite and meaningful manner without getting overly detailed and misdirected.


Warning:
Ensure that you don't have any lingering Lazarus User AppData from pre-existing installations --this will cause problems if the installations are not identical. Lazarus IDE Secondary Installations automate a work-around for having multiple Lazarus installations that must persist independently --simply check the Secondary Installation box when installing the IDE then choose a directory for configuration data and continue getting set-up from there.

Displaying hidden folders in Windows 10 Explorer:
To show hidden folders in Windows 10 click the View tab of Explorer and check the Hidden items box on the right side of the menu ribbon and you are ready to roll out.

Lazarus IDE AppData location:
User Folder (for your account)\AppData\Local\lazarus --you may have to "un-hide" hidden folders to access AppData.


01. Download lazarus-1.6.0-fpc-3.0.0-win64.exe from SourceForge;

02. Download fpc-3.0.0.i386-win32.cross.x86_64-win64.exe from SourceForge;

03. Right-click lazarus-1.6.0-fpc-3.0.0-win64.exe and check the "Unblock" box;

04. Right-click fpc-3.0.0.i386-win32.cross.x86_64-win64.exe and check the "Unblock" box;

05. Install lazarus-1.6.0-fpc-3.0.0-win64.exe (best if done as admin to the root drive C:\ of Windows);

06. Install fpc-3.0.0.i386-win32.cross.x86_64-win64.exe to the Lazarus/fpc/fpc version directory (preferrably as admin);

07. Start Lazarus IDE Click Tools then select Configure "Build Lazarus" ... from the menu drop down;

08. Change Target OS: to Win64 and Target CPU: to x86_64 leaving everything else default then click Build;

09. Let Lazarus rebuild itself, it will automatically re-start itself;

10. Click Project then select Project Options;

11. Click Config and Target of Compiler Options on the left side of the dialog;

12. Locate Target platform on the right side of the dialog;

13. Change Target OS (-T) to Win64;

14. Change Target CPU family (-P) to x86_64;

15. Click the OK button and you are ready to develop a 64bit FPC GUI application system.


NOTICE:
You must install the 64bit version of Lazarus IDE in order to develop 64bit FPC GUI applications; you must also install the FPC cross compiler mentioned above. I had issue with installing the cross compiler anywhere outside the nested FPC direcory in the Lazarus IDE installation directory --it would not work anywhere else. You may want to start a new project after getting setup by re-starting Lazarus IDE then do a run, open Windows Task Manager and verify the 'project1.exe' and not 'project1.exe (32bit)'. If the application process is identified as project1.exe then Lazarus is building 64bit applications by default --you're all set.


Example Installation:
C:\lazarus for the default install path for the 64bit Lazarus IDE installation.
C:\lazarus\fpc\3.0.0 for the fpc-3.0.0.i386-win32.cross.x86_64-win64.exe cross-compiler.

Any questions or suggestions for quality purposes concerning this thread's content will be considered when possible. This content is aimed at being precise, succinct and easily digestable; if you (the reader) have not understood the directions in your first read through or something seems unclear say so below in the comments.
« Last Edit: September 29, 2016, 09:57:07 am by TheRaven »

molly

  • Hero Member
  • *****
  • Posts: 1916
Re: 64bit Development Environment Setup basics
« Reply #1 on: September 29, 2016, 10:14:04 am »
Perhaps i'm missing something here... in which case i apologize upfront, but:

Quote
05. Install lazarus-1.6.0-fpc-3.0.0-win64.exe (best if done as admin to the root drive C:\ of Windows);
We're installing the 64 bit version of Lazarus. That's ok.

Quote
06. Install fpc-3.0.0.i386-win32.cross.x86_64-win64.exe to the Lazarus/fpc/fpc version directory (preferrably as admin);
Now we're installing the 32-bit version of FPC able to cross-compile to 64-bit.... that's just plain weird ?

I would expected to install lazarus-1.6.0-fpc-3.0.0-cross-i386-win32-win64.exe so that someone is also able to target 32-bit windows.

Quote
07. Start Lazarus IDE Click Tools then select Configure "Build Lazarus" ... from the menu drop down;
08. Change Target OS: to Win64 and Target CPU: to x86_64 leaving everything else default then click Build;
We are rebuilding the 64 bit version of Lazarus to create... a 64-bit version of Lazarus.... seems redundant to me ?


Thaddy

  • Hero Member
  • *****
  • Posts: 4519
Re: 64bit Development Environment Setup basics
« Reply #2 on: September 29, 2016, 10:25:18 am »
Oooooh and how about this kind of advice:
Quote

05. Install lazarus-1.6.0-fpc-3.0.0-win64.exe (best if done as admin to the root drive C:\ of Windows);

06. Install fpc-3.0.0.i386-win32.cross.x86_64-win64.exe to the Lazarus/fpc/fpc version directory (preferrably as admin);

OF COURSE NOT!
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

molly

  • Hero Member
  • *****
  • Posts: 1916
Re: 64bit Development Environment Setup basics
« Reply #3 on: September 29, 2016, 10:37:00 am »
OF COURSE NOT!
Good. It is not only me (i actually thought i had some weird kind of memory twist that blocked me from thinking straight) :D

It might explain why TS has/had such difficulty to begin with in setting up a lazarus 64-bit dev environment.

In principle you need to do two simple things (or actually 1 if you only wish to target win 64-bit).
- Download and install  lazarus-1.6.0-fpc-3.0.0-win64.exe
- In case want to cross-compile to win32, download and install lazarus-1.6.0-fpc-3.0.0-cross-i386-win32-win64.exe
Done  :)

Would be interesting to know from TS what is not working when done so.

Thaddy

  • Hero Member
  • *****
  • Posts: 4519
Re: 64bit Development Environment Setup basics
« Reply #4 on: September 29, 2016, 11:57:07 am »
With permission of TS this thread should be removed altogether. If it shows up in any searches we have to "support" this kind of erronial information forever.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

TheRaven

  • Newbie
  • Posts: 4
Re: 64bit Development Environment Setup basics
« Reply #5 on: September 30, 2016, 04:14:00 am »
With permission of TS this thread should be removed altogether. If it shows up in any searches we have to "support" this kind of erronial information forever.

Suggestions are welcome, but flaming accomplishes nothing; the steps listed above actually work and I am currently using those exact methodologies and installation right now. If there's a faster, more reliable method of accomplishing the same thing then post the solutions by reference. The 32 installation of the cross compiler was in fact the most current and only cc I could find at SourceForge and was used to convert a previous 32bit application to the 64bit equ.

Handoko

  • Hero Member
  • *****
  • Posts: 1656
  • My goal: build my own game engine using Lazarus
Re: 64bit Development Environment Setup basics
« Reply #6 on: September 30, 2016, 04:48:40 am »
Hello TheRaven,
Welcome to this forum.

Thank you for your compiling instruction, it can be useful for many users.

I'm a Linux user, so nothing much I can said. But I know both molly and Thaddy are experienced in cross compiling, what they said should have some useful points that can improve the instruction.

Have fun.

Akira1364

  • Sr. Member
  • ****
  • Posts: 311
Re: 64bit Development Environment Setup basics
« Reply #7 on: October 03, 2016, 06:37:33 am »
Uh, what? You state your intention is to provide instructions for setting up a stable 64-bit Windows development environment, but then immediately recommend installing the 32-bit cross-compiler on top of the pure 64-bit Lazarus/FPC combination provided by the first installer (which is almost certainly going to lead to immense confusion in the case of an absolute beginner).

The SourceForge files are standard windows installers. If you want 64-bit, just download and install lazarus-1.6.0-fpc-3.0.0-win64.exe. If you want 32-bit, just download and install lazarus-1.6.0-fpc-3.0.0-win32.exe. The end.

Graeme

  • Hero Member
  • *****
  • Posts: 1410
    • Graeme on the web
Re: 64bit Development Environment Setup basics
« Reply #8 on: October 03, 2016, 08:47:38 am »
Very nice TheRaven, but here is an even simpler solution - which also allows you to compile 64/32-bit FreeBSD, 64/32-bit Linux and 32-bit Windows applications. Simply download and run - everything is already configured. You can even transfer the installation to a USB stick for running on any system only using a USB stick. I'm pretty sure with a bit more work, even 64-bit Windows support could be added. But the nice thing of Windows (if there is such a thing) is that 64-bit Windows can run 32-bit Windows applications without any further effort.

Quote
-------- Forwarded Message --------
Subject: polYdev release 1.0
Date: Tue, 20 Sep 2016 17:32:15 -0000
From: fredvs <fredvs@spamfilter.co.za>
Newsgroups: fpgui.support

Hello.

polYdev release 1.0 is ready to download.

polYdev is a multiarch FreeBSD 10.3 operating system.

Thanks to his emulators, polYdev is able to compile and run applications for
FreeBSD 64/32, Linux 64/32 and Windows 32 bit.


No virtual machines needed, the compilations are fast and use the native
compiler of each system.

polYdev is shipped/configured with fpc 3.0.0 for FreeBSD 64/32, Linux 64/32,
and Windows 32 bit.

Here how to install polYdev:

- Download the release from here:   https://mega.nz/#!fwwRkLrQ

  This is the key Mega will ask:
  !0Pw4NOrCbiCffB3cZ7IrhY52cmaAp3Oa-jU99y5hNPY

- Load and run the iso.

- If you use a virtual machine, 2GB of ram are needed.

- When the system is installed on device, install programs via menu "Install
programs".
  This will install fpc and all the needed libraries for poly-compiling.

- In /usr/local/share/ideu/prj_test_multisys/, there are demos of fpGUI and
MSEgui poly-system.

  You may test it with ideU, all is pre-configured.
   The source of all fpc fpGUI and MSEgui applications in the disto are in
/dist/src.

- Enjoy. ;-)

Fre;D
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

molly

  • Hero Member
  • *****
  • Posts: 1916
Re: 64bit Development Environment Setup basics
« Reply #9 on: October 03, 2016, 05:57:37 pm »
@TheRaven:
I understand that you've put a lot of effort in your experiments and write up. There is no discussion on wether that is appreciated or not.

However, Thaddy's point (however harsh it might perhaps sound) is a valid one.

People stumbling upon your writings might actually take it seriously and follow your instructions. Are you taking the responsibility for helping all those that end up in misery because they now have a screwed up setup ?

Suggestions are welcome,
I did make them, i did not got a response.

Quote
the steps listed above actually work and I am currently using those exact methodologies and installation right now.
In which case you are doing it wrong.

Quote
If there's a faster, more reliable method of accomplishing the same thing then post the solutions by reference.
Posted.

I even asked what are your problems by using one single installation so that in case of errors/bugs we can sort them out so the development team is able to address them properly.

I did not got a response.

Quote
The 32 installation of the cross compiler was in fact the most current and only cc I could find at SourceForge and was used to convert a previous 32bit application to the 64bit equ.
You say you have written up instructions for installing a 64-bit lazarus/fpc development environment for a 64-bit windows.

With that knowledge the above quote makes absolutely no sense whatsoever.

Speaking of a cat blaming the cattle. Where are your references ?  ;D

TheRaven

  • Newbie
  • Posts: 4
Re: 64bit Development Environment Setup basics
« Reply #10 on: October 04, 2016, 04:37:54 am »
Uh, what? You state your intention is to provide instructions for setting up a stable 64-bit Windows development environment, but then immediately recommend installing the 32-bit cross-compiler on top of the pure 64-bit Lazarus/FPC combination provided by the first installer (which is almost certainly going to lead to immense confusion in the case of an absolute beginner).

The SourceForge files are standard windows installers. If you want 64-bit, just download and install lazarus-1.6.0-fpc-3.0.0-win64.exe. If you want 32-bit, just download and install lazarus-1.6.0-fpc-3.0.0-win32.exe. The end.

I had stated previously that I had issues with the 64bit installation of Lazarus compiling 64bit applications --three separate instances Lazarus was re-installed in an attempt to trouble shoot. I have both the 32bit and 64bit versions of Laz, but decided to go at converting an app I authored in 32bit with Laz to 64bit and tested the IDE with an empty project first; the empty project would not compile to 64bit even after I set the IDE up for 64bit projects, but it would compile 32Bit. Read other threads and the same issue was encountered with a maelstrom of mixed complaints and compiling the compiler or IDE from source and that led me to just try and do it on my own.

After reading all the other threads and searching on Google I began to assume that Laz 64bit was a 64bit ide as it was developed in 64bit, but needed the cross compiler to actually compile 64bit apps. So I downloaded the cross-compiler and installed it in the FPC version directory and everything seem to start running. I was still not sure at the time that anything might be wrong after that point because I cross-compiled my 32bit app to 64bit; at any rate, still uncertain about everything that went on up to that point decided to post my steps in getting rolling with Laz 64bit and developing 64bit compiled apps. Additionally, concerning all of the issues I encountered and the possibility that I could get feedback to refine what I was doing and possibly catch any hidden/prevent future issues and mistakes let it be known that I would appreciate any feedback.

I numbered the steps so that anyone choosing to correct any crap instruction(s) could reference the bad instruction or offer advice to clarify/refine the process on a whole. You get what I was doing now? I don't care about b!tching show me where the stuff is incorrect and I'll change it --it's only going to help me as well as many others --see what I'm saying. I still appreciate your effort providing some feedback and am in the process of trying another clean install of Laz 64bit, if I run into the same problems I'll post again --there's a distinct possibility that it's Windows related and not the IDE itself too (hopefully not).

TheRaven

  • Newbie
  • Posts: 4
Re: 64bit Development Environment Setup basics
« Reply #11 on: October 04, 2016, 04:48:14 am »
@TheRaven:
I understand that you've put a lot of effort in your experiments and write up. There is no discussion on wether that is appreciated or not.

However, Thaddy's point (however harsh it might perhaps sound) is a valid one.

People stumbling upon your writings might actually take it seriously and follow your instructions. Are you taking the responsibility for helping all those that end up in misery because they now have a screwed up setup ?

Suggestions are welcome,
I did make them, i did not got a response.

Quote
the steps listed above actually work and I am currently using those exact methodologies and installation right now.
In which case you are doing it wrong.

Quote
If there's a faster, more reliable method of accomplishing the same thing then post the solutions by reference.
Posted.

I even asked what are your problems by using one single installation so that in case of errors/bugs we can sort them out so the development team is able to address them properly.

I did not got a response.

Quote
The 32 installation of the cross compiler was in fact the most current and only cc I could find at SourceForge and was used to convert a previous 32bit application to the 64bit equ.
You say you have written up instructions for installing a 64-bit lazarus/fpc development environment for a 64-bit windows.

With that knowledge the above quote makes absolutely no sense whatsoever.

Speaking of a cat blaming the cattle. Where are your references ?  ;D

The instructions are a compilation of the actual steps that I performed in getting Laz installed and compiling a 64bit test app, then converting a 32bit to 64bit app. Both operations were successful after I had installed the cross-compiler and assumed that the CC was 32bit to 64bit not the other way around --mmkay! Now- I posted the steps numbered as they are so that anyone can directly cite a faulty instruction or offer advice that would influence corrective action where the instructions get edited for correctness. This isn't a blame game it's a this is what I did can someone look at the stuff and help me refine this crap so I am not guessing about what actually needs to happen.

I also thought that I made it clear in previous posts that I had encountered issues with compiling and even some setup miles away from trying to misdirect anyone into installing anything faulty. I am going to re-install Laz 64bit again this time try to re-do all the steps with the exception of installing the cc. I'll report what I encounter and do appreciate the positive feed-back and as soon as I get this crap smoothed over I make the necessary corrections and will appreciate any future input you may have. TC.

molly

  • Hero Member
  • *****
  • Posts: 1916
Re: 64bit Development Environment Setup basics
« Reply #12 on: October 04, 2016, 06:54:56 am »
The instructions are a compilation of the actual steps that I performed in getting Laz installed and compiling a 64bit test app, then converting a 32bit to 64bit app.
You do not need a 32-bit to 64-bit cross-compiler in order to compile a source for a 64-bit target and you definitely do not need a standalone Free Pascal cross compiler. A project should be compilable for every supported target, no matter on/for which processor it was created. (let's forget about different widgetsets and other operating systems there for a moment).

Quote
Both operations were successful after I had installed the cross-compiler and assumed that the CC was 32bit to 64bit not the other way around --mmkay!
Which seem to indicate that without doing so you had issues. Please report them instead of installing a 32 to 64 bit FPC cross-compiler.

If you think about that for a moment... let it sink in... you have a 64-bit lazarus/fpc installed and on top of that you are adding a fpc 32 to 64-bit cross-compiler. What good would that cross-compiler do exactly ?

For more explanation see also below answer.

Quote
This isn't a blame game it's a this is what I did can someone look at the stuff and help me refine this crap so I am not guessing about what actually needs to happen.
Except for the specifics you mentioned concerning OS related actions (such as unblocking, installing as admin) you only need to do one thing and that is installing Lazarus.

Now, for 64-bit Windows that can mean one of two choices:
1) you install the 32-bit version of lazarus/fpc (and in case you also wish to create 64-bit applications, install the lazarus 64-bit cross-compiler addon)
2) you install the 64-bit version of lazarus/fpc (and in case you also wish to create 32-bit applications, install the lazarus 32-bit cross-compiler addon)

Of course, you are more than welcome to install both combinations at the same time (but i personally would not recommend that unless you know what you are doing).

Quote
I also thought that I made it clear in previous posts that I had encountered issues with compiling and even some setup miles away from trying to misdirect anyone into installing anything faulty.
You talked about instructions you have read that talked about compiling lazarus/fpc from source and that this did not work for you.

For all official supported platforms, every fpc/Lazarus release can also be compiled from source if you wish to do so and many people (including myself) have done so without any problems (well, in practice there are the occasional hiccups but they are reported and usually fixed asap in order to await inclusion of these fixes in a new (fix)release).

Also both Free Pascal and Lazarus comes in ready to go installation packages for a variety of platforms. The only thing you need to do for that is pick/download the right one for your OS and install it.

And that's actually it. Nothing more, nothing less.

Quote
I am going to re-install Laz 64bit again this time try to re-do all the steps with the exception of installing the cc.
As a friendly advise.
1) make sure you absolutely clean up all your old installations. Any remnant left from a previous installation can influence a new installation.
2) forget about your steps for a moment (keep them in mind though). Simply install the 64-bit version of lazarus and do not install anything else. Use your unblock/admin steps in case that helps you (keep in mind they only apply for your personal setup only), but do not install anything besides that one Lazarus installation package

Quote
I'll report what I encounter and do appreciate the positive feed-back and as soon as I get this crap smoothed over I make the necessary corrections and will appreciate any future input you may have. TC.
Any issues you encounter by just installing the 64-bit version of Lazarus would be highly appreciated.

As another friendly advise: frustration is never a good advisory.

Sometimes things simply go wrong with a lazarus/fpc release, sometimes people have an out of the ordinary setup, sometimes a (new) operating system (such as windows 10) confronts users with new security measures that have to be dealt with etc. etc.

The only part that we as users can control/influence is at least report Lazarus/FPC related issues so that developers are able to fix these (in case they need fixing).

PS: i see now that in your reply to Akira1364 you changed the rules of the game by mixing 32 and 64 bit lazarus. Which mean you have to obey the rules of having multiple installations of lazarus.

First reaction would be that you messed things up considerably because of that as that might perhaps explain the odd FPC cross-compiler installation.
« Last Edit: October 04, 2016, 07:15:40 am by molly »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus