Page 1 of 1

Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 3:04 pm
by Justin
I am really fed up with the PB IDE crashing every 10 seconds, coding is impossible.
So i am looking for alternatives, so far i just googled and found these ones:
http://blog.agileactors.com/blog/2017/1 ... d-compared

I am testing Geany right now.
I just need something that can be configured with the pbcompiler, syntax highlighting, maybe project support, just the basic things to get you coding in pb.
Does anyone have any experience and could post opinions and a little guide for a quick set up?
I know there are more people with this problem, maybe we could start trying that list and post the results.

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 4:00 pm
by Justin
I did quick test with Geany but failed:

If you go to Build > Set Build Commands
In the Execute commands fill:
In the 'Command' editbox: your_pb_compilers_path/pbcompiler -h
Launches the pbcompiler and shows the help.

But: your_pb_compilers_path/pbcompiler %d/%e.pb

Shows

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.


------------------
(program exited with code: 1)
Press return to continue

I tried setting the working directory to the purebasic/compilers/ and does not work,
any hints?

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 5:40 pm
by Justin
Every single program i try vs code, code blocks.. i keep getting the same error, what am i missing?
vs code seems the best.

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 7:59 pm
by Justin
I read the INSTALL file on pb dir and used method 2.
Now i can compile from any terminal and the exe launches normaly, but when i try to compile from those ide programs the pbcompiler launches, compiles the program but it is not executed, a file purebasic.out is created.
Any help?

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 9:04 pm
by Justin
Got it to work in code blocks

in geany only works with files in the local hd not in usb

vs code does not work

does not work means it compiles but does not launch the exe, maybe a permissions issue?

any help will be appreciated.

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 11:13 pm
by mk-soft
I found this...
Link viewtopic.php?f=15&t=70470

It's easier:
- Open your "personal folder".
- Show hidden files
- edit the file".bashrc"

Add the following lines
export PUREBASIC_HOME=[path to purebasic] - example: /home/yourname/Apps/purebasic-v562
export PATH=$PUREBASIC_HOME/compilers:$PATH
Save ".bashrc"

P.S. The pbcompiler need the envoirment variable "PUREBASIC_HOME"

Re: Any reliable Linux IDE for PB?

Posted: Sun Sep 02, 2018 11:43 pm
by Justin
I also did that, from any terminal it works and launches the pb exe using
pbcompiler file.pb

But with those programs when configuring the tools passing that command line they only compile the executable, and don't run it.

Re: Any reliable Linux IDE for PB?

Posted: Mon Sep 03, 2018 2:00 pm
by Marc56us
(Linux Slackware 14.2 - Purebasic 5.62 x64 in ~/Documents/purebasic)
Hello.pb

Code: Select all

OpenConsole()
PrintN("Hello World")
Input()
$ PS1='\w \$ '
~/Documents $ purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.


~/Documents $ export PUREBASIC_HOME=~/Documents/purebasic

~/Documents $ echo $PUREBASIC_HOME
/home/marc/Documents/purebasic

~/Documents $ purebasic/compilers/pbcompiler Hello.pb -e Hello

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Starting compilation...
Starting compilation...
4 lines processed.
Creating the executable.

- Feel the ..PuRe.. Power -

~/Documents $ file Hello
Hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

~/Documents $ ./Hello
Hello World

:arrow: You need to set PUREBASIC_HOME to purebasic root folder even if you compile from compiler folder

:D
but it is not executed, a file purebasic.out is created
So it's works. purebasic.out is the name of the compiled file if you don't specify -e
The compiler (command line) does not launch executable after compiling.
You need to launch it yourself (./purebasic.out)
Remember that under unix, there is no PATH on the local directory (security). You must specify the full name or (./name) to launch a program.

:wink:

Edit: Hum, sometime executable is launch after compiling
Reset for testing

$ PS1='[\w \$] '
[~/Documents $] cd ~/Documents/
[~/Documents $] export PUREBASIC_HOME=
[~/Documents $] echo $PUREBASIC_HOME
(nothing)
[~/Documents $] purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.

[~/Documents $] export PUREBASIC_HOME=~/Documents/purebasic
[~/Documents $] echo $PUREBASIC_HOME
/home/marc/Documents/purebasic
(yes)
[~/Documents $] purebasic/compilers/pbcompiler Hello.pb

******************************************
PureBasic 5.62 (Linux - x64)
******************************************

Loading external modules...
Starting compilation...
Starting compilation...
4 lines processed.
Creating the executable.

- Feel the ..PuRe.. Power -

Hello World

Re: Any reliable Linux IDE for PB?

Posted: Mon Sep 03, 2018 3:38 pm
by mk-soft
Its work for me

A little trick to start extern debugger over small script

Create script "calldebugger.sh" and save to "purebasic/compilers" folder
pbcompiler --debugger "$1" -e "$2"
pbdebugger $2
Program "RunCompiler" to start script..

Code: Select all

Import "-no-pie"
EndImport

Global file.s, out.s, param.s
file = ProgramParameter(0)
If Bool(file)
  If Left(file,1) <> "/"
    file = GetCurrentDirectory() + file
  EndIf
Else
  file = OpenFileRequester("PB-File", "", "", 0)
EndIf
If Bool(file)
  out = #DQUOTE$ + GetPathPart(file) + GetFilePart(file, #PB_FileSystem_NoExtension) + #DQUOTE$
  file = #DQUOTE$ + file + #DQUOTE$
  param = "calldebugger.sh " + file + " " + out
  Compiler = RunProgram("bash", param, "", #PB_Program_Open | #PB_Program_Read)
  Output$ = ""
  If Compiler
    While ProgramRunning(Compiler)
      If AvailableProgramOutput(Compiler)
        Output$ + ReadProgramString(Compiler) + Chr(13)
      EndIf
      Delay(20)
    Wend
    Output$ + Chr(13) + Chr(13)
    Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
    
    CloseProgram(Compiler) ; Schließt die Verbindung zum Programm
  EndIf
  MessageRequester("Output", Output$)
EndIf

Re: Any reliable Linux IDE for PB?

Posted: Mon Sep 03, 2018 5:57 pm
by Bitblazer
OpenSuse Leap 15 works fine with the Linux PB IDE and has all the features i need. I switched from *Ubuntu distros after trying to fix compatibility issues for a few days.

Re: Any reliable Linux IDE for PB?

Posted: Mon Sep 03, 2018 7:56 pm
by mk-soft
Bitblazer wrote:OpenSuse Leap 15 works fine with the Linux PB IDE and has all the features i need. I switched from *Ubuntu distros after trying to fix compatibility issues for a few days.
I'm running it under Ubuntu Gnome and Budgie.
What problems?

Re: Any reliable Linux IDE for PB?

Posted: Mon Sep 03, 2018 9:00 pm
by swhite
Hi

I use OpenSuse Leap 42.3 and this is reasonable reliable. I do occasionally have the IDE vanish but not everyday. I am not sure what triggers this behavior because it will work fine for days and then all of a sudden it will vanish and I have to restart the IDE.

I have not had a chance to update to Opensuse 15 to see if it is better.

Simon

Re: Any reliable Linux IDE for PB?

Posted: Tue Sep 04, 2018 12:06 am
by Justin
Thanks for the help. It seems that visual studio code is a good option, finally i got it to work using "tasks", if anyone is interested i used:

Code: Select all

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "PB Build",
            "type": "shell",
            "command": "pbcompiler -d /fullpath/yourfile.pb"
        },

       {
            "label": "PB Run",
            "type": "shell",
            "command": "fullpath/purebasic.out"
        },

    ]
}
You can assign shortcuts to the tasks.
It's strange i had to use two tasks one for build and for run, gluing the commands with "&&" launches the executable twice!
More strange if you simply type 'pbcompiler file.pb' in the vs code terminal, builds and run the executable normally.

Re: Any reliable Linux IDE for PB?

Posted: Tue Sep 04, 2018 6:23 am
by Marc56us
This is what I indicated, sometimes the command line compiler (pbcompiler) runs the exe after compiling but not every time.

Re: Any reliable Linux IDE for PB?

Posted: Wed Sep 05, 2018 9:14 pm
by Justin
Finally i got visual studio code to compile and run saving all files with a single F5 key press, it took me two days LOL. i had to download the macros extension, because unbelievably there is not an option to save all before build.
I can post the steps if someone is interested.

With a lot of work this editor could be totally customized for PB.