wsl: convincing FPC that it is on Linux lazarus / 34-Windows ---------------------------------------------------------------------- marcov · 2018-08-18 16:42 I just installed debian WSL, and tried to compile FPC. I run make clean all PP=~/ppcx64  but make terminates with QuoteMakefile:135: *** Compiler /home/marcov/ppcx64.exe not found.  Stop. so it adds an extension because it thinks it is on Windows. make info gives typical windows output. OS_SOURCE=linux doesn't really help either. Anybody info on running FPC on Windows/wsl-linux ? ---------------------------------------------------------------------- Thaddy · 2018-08-18 20:15 I installed fpc from the repositories with apt-get. then you get 2.6.2 on my version. subsequently built 3.0.4 with 2.6.2. The wsl version is ubuntu trusty+backports. [edit] in two stages. ---------------------------------------------------------------------- Thaddy · 2018-08-19 04:01 Note that gives you a ppcx64 compiler. steps I did: 1. install fpc from apt repository, this is 2.6.2 x86_64 2. co 3.0.2 compiler and rt|l cd compiler|make  // just the compiler to bootstrap later 3. co 3.0.4 | make all install PP=/the/path/to/your/302/compiler/ppcx64 ---------------------------------------------------------------------- Thaddy · 2018-08-19 09:45 Marco, I can't imagine you did that but: It is possible to invoke ppcx64-linux  from a Windows console! But that won't work for a build. You need to invoke fpc and make from a Linux console (bash in my case) that is also provided by wsl. Just in case... ---------------------------------------------------------------------- marcov · 2018-08-19 09:54 I ran the command from debian's bash and the compiler was one I got from a linux system (and ran if you used ./ppcx64) If I type make info however, I see all files taken from my /mnt/c/pp32 normal trunk FPC install. I have a feeling the OS detection of the makefile goes wrong. But I'll see if I can get a TAR installer to get a full linux FPC install. p.s. debian FPC packages are IMHO not worth going through that kind of trouble, just get the tar. ---------------------------------------------------------------------- FPK · 2018-08-19 11:22 bash -c "make FPC=/home/marcov/ppcx64 all -j" ---------------------------------------------------------------------- marcov · 2018-08-19 12:07 Quote from: FPK on August 19, 2018, 01:22:28 pmbash -c "make FPC=/home/marcov/ppcx64 all -j" Same problem.   I cleaned out my  $path, and now it works. So something found in the path convinced it that the source OS was windows, and OS_SOURCE=linux didn't convince it otherwise. Bad if something can't be overriden. Then it bombs on development libraries, I assume I have to install build-essentials or something like it. ---------------------------------------------------------------------- lucamar · 2018-08-19 12:33 Quote from: marcov on August 19, 2018, 02:07:24 pm[....] something found in the path convinced it that the source OS was windows, [...] I had this problem once upon a time (compilign a 2.6.x) and it happened because there was a ; in PATH, which made it think it was a Windows PATH. Quote from: marcov on August 19, 2018, 02:07:24 pm[...] I assume I have to install build-essentials or something like it. Yes, and all the *-dev dependencies. The Build-FAQ is your friend here, though not a very good friend. ---------------------------------------------------------------------- marcov · 2018-08-19 12:47 Quote from: lucamar on August 19, 2018, 02:33:56 pmQuote from: marcov on August 19, 2018, 02:07:24 pm[....] something found in the path convinced it that the source OS was windows, [...] I had this problem once upon a time (compilign a 2.6.x) and it happened because there was a ; in PATH, which made it think it was a Windows PATH. Well, I think in this case it is the pwd.exe in the path that sets the SRCEXEEXT. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))ifneq ($(findstring darwin,$(OSTYPE)),)inUnix=1 #darwinSEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))elseifeq ($(findstring ;,$(PATH)),)inUnix=1SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))elseSEARCHPATH:=$(subst ;, ,$(PATH))endifendifSEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))ifeq ($(PWD),)PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))ifeq ($(PWD),)$(error You need the GNU utils package to use this Makefile)elsePWD:=$(firstword $(PWD))SRCEXEEXT=endifelsePWD:=$(firstword $(PWD))SRCEXEEXT=.exeendififndef inUnixifeq ($(OS),Windows_NT)inWinNT=1elseifdef OS2_SHELLinOS2=1endifendifelseifneq ($(findstring cygdrive,$(PATH)),)inCygWin=1endif Builtin variables OS and OSTYPE seem to be also used QuoteQuote from: marcov on August 19, 2018, 02:07:24 pm[...] I assume I have to install build-essentials or something like it. Yes, and all the *-dev dependencies. The Build-FAQ is your friend here, though not a very good friend. I'm supposed to know it by heart, since I wrote it :-) ---------------------------------------------------------------------- Thaddy · 2018-08-19 15:35 what happens when you just use the compiler like this: fpc -Tlinux helloworld.pas But then again, an install from the apt repository indeed draws in buildessential as a dependency as well as several other -dev packages that you otherwise need to install by hand. I suggest you follow my path: install 2.6.2 , build 3.0.2 compiler only, use that to bootstrap the higher versions. Slightly more work, but worked for me on a second system too. I tested that this morning. Also note: is there an fpc.cfg in the way? Check for one in /etc/fpc.cfg ---------------------------------------------------------------------- lucamar · 2018-08-19 16:22 Quote from: marcov on August 19, 2018, 02:47:29 pmQuote from: lucamar on August 19, 2018, 02:33:56 pmThe Build-FAQ is your friend here, though not a very good friend. I'm supposed to know it by heart, since I wrote it :-) Oops! ---------------------------------------------------------------------- Thaddy · 2018-08-19 18:18 Quote from: lucamar on August 19, 2018, 06:22:48 pmOops!  Marco seldom asks questions. If he does, the answer is often complex.