OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:47 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Share how to compile difficult programs
PostPosted: Mon Sep 11, 2017 12:40 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1225
Can you share detailed instructions, videos, code, about compiling known hard-to-compile programs?

No matter what the program is about, it will always be useful, and no matter for what platform, PC or handheld.



The latest most difficult program I learned to compile was ZSNES 1.51 for DOS using DJGPP:

Code:
make -f makefile.ms PLATFORM=dos

Use the very latest and full version of DJGPP, its bash port, and utilities.

ZSNES 1.51 source code:
https://sourceforge.net/projects/zsnes/files/zsnes/ZSNES%20v1.51/zsnes151src.tar.bz2/download

Information on compiling ZSNES 1.51 for DOS, Windows, Linux:
https://github.com/emillon/zsnes/blob/master/docs/install.txt

Compile 1.51 in DJGPP:
http://board.zsnes.com/phpBB3/viewtopic.php?f=6&t=137399&view=next

DJGPP 2.05 download and information:
http://devel.archefire.org/forum/viewtopic.php?hl=es&p=4306#p4306



http://www.zlib.net/zlib-1.2.11.tar.gz

https://sourceforge.net/projects/libpng/files/libpng14/1.4.21/lpng1421.zip/download



Add #include to stdio.h to all source files in the "tools/" directory that don't already include it, and also to parsegen.cpp in the root source directory.

Copy the libpng include files to the DJGPP include directory, no matter if you destroy it for other projects, you should modify a temporary install of DJGPP for this compilation. Do the same for zlib if any ZIP related errors appear during the compilation.


Edit the file makefile.ms and delete any -Ws GCC switch as DJGPP doesn't recognize it.
Also search for any -lpdcur occurrence and change it to -lpdc~1


_________________
Live PC 1: Image Live PC 2: Image

YouTube:
http://youtube.com/@AltComp126/streams
http://youtube.com/@proyectos/streams

http://master.dl.sourceforge.net/projec ... 7z?viasf=1


Last edited by ~ on Wed Sep 20, 2017 2:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Wed Sep 13, 2017 3:29 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
Oh how I despise "video instructions"... non-searchable, non-siftable, at the mercy of the presenter's speed and timing...

Besides, shouldn't instructions on how to compile known hard-to-compile programs be posted to the respective program's support forums instead of being collected in a OSDev.org thread?

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Wed Sep 13, 2017 4:39 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
+1

Surely if something is hard to compile using the build system recommended by the developer, that should be a bug that they need to fix so that it isn't hard to compile? Having said that, the only tools I ever compile are OSDev tools on Bash on Ubuntu on Windows, so maybe this view is slightly naïve.

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Sun Sep 17, 2017 6:09 am 
Offline
Member
Member

Joined: Thu Jul 03, 2014 5:18 am
Posts: 84
Location: The Netherlands
Personally I think there is little use in "learning" how to compile a specific program. Instead, you should focus your effort on learning how to compile any piece of software.

The build process is merely a means to an end, not a goal itself.

_________________
My blog: http://www.rivencove.com/


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Sun Sep 17, 2017 6:45 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
http://wiki.osdev.org/Cross-Porting_Software


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Mon Sep 18, 2017 6:01 pm 
Offline
Member
Member

Joined: Wed Nov 18, 2015 3:04 pm
Posts: 396
Location: San Jose San Francisco Bay Area
99% pct of compile attempt that I follow through the instruction fails. IMO, it is problem with industry, degenerate so-called developers who call themselves who cares nothing but their own build environment setup in their tiny cubicle. In the end, I usually chose not to pursue the effort if does not work on first try because it is never ending journey. Most of the time, instruction are inaccurate, incomplete and/or simply wrong.
In the past various build attempt failure I have seen:
Most of the linux utility, application source does not compile, not even close, dependency problem is difficulty to resolve. I dont remember any linux uitility that compiled right off the bat, the only exception I can remember is iperf. That is about it. The recent ones I remember that failed miserably : wireshark, AI framework i.e. tensorflow, caffe, bitcoin-cli. It is a compile-and-pray thing. (Remember plug-and-pray?).
UEFI source, even the people who were actively involved in maintaining could not setup the build environment fresh start.

_________________
key takeaway after spending yrs on sw industry: big issue small because everyone jumps on it and fixes it. small issue is big since everyone ignores and it causes catastrophy later. #devilisinthedetails


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Tue Sep 19, 2017 12:37 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
I find that almost all Linux applications compile first time, as long as I read the README and ensure that any dependencies are installed before attempting to compile the main program. Perhaps I'm just lucky.

I certainly see no point in documenting individual programs here - documentation belongs with the program source, not with a website about OS development.


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Tue Sep 19, 2017 10:55 pm 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
Just recall how many people, over the years, complained about the cross-compiler tutorial in our wiki "not working".

Hundreds?

And every single time, it turned out they were missing something along the lines, hadn't really followed the instructions or made some other newb mistake...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Wed Sep 20, 2017 1:35 am 
Offline
Member
Member

Joined: Wed Nov 18, 2015 3:04 pm
Posts: 396
Location: San Jose San Francisco Bay Area
Solar wrote:
Just recall how many people, over the years, complained about the cross-compiler tutorial in our wiki "not working".

Hundreds?

And every single time, it turned out they were missing something along the lines, hadn't really followed the instructions or made some other newb mistake...

Yes there are hundreds but also am afraid there are shoddy instructions and documentations everywhere. As for myself, speaking from my experience, I read line by line digest every word written, still most open source does not compile whatever documentation comes along are mostly POC. Even the publisher say something like "it everything goes well", "hope this works", "try this". In a strictest sense it is hesitation, uncertainty and usually problematic.

_________________
key takeaway after spending yrs on sw industry: big issue small because everyone jumps on it and fixes it. small issue is big since everyone ignores and it causes catastrophy later. #devilisinthedetails


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Wed Sep 20, 2017 2:32 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1225
Solar wrote:
Oh how I despise "video instructions"... non-searchable, non-siftable, at the mercy of the presenter's speed and timing...

Besides, shouldn't instructions on how to compile known hard-to-compile programs be posted to the respective program's support forums instead of being collected in a OSDev.org thread?


I always do my best to include the instructions in text form to my video tutorials, which exist just in the known ~99% likely case that the person compiling will not understand them readily:
Code:
make -f makefile.ms PLATFORM=dos

Use the very latest and full version of DJGPP, its bash port, and utilities.

ZSNES 1.51 source code:
https://sourceforge.net/projects/zsnes/files/zsnes/ZSNES%20v1.51/zsnes151src.tar.bz2/download

Information on compiling ZSNES 1.51 for DOS, Windows, Linux:
https://github.com/emillon/zsnes/blob/master/docs/install.txt

Compile 1.51 in DJGPP:
http://board.zsnes.com/phpBB3/viewtopic.php?f=6&t=137399&view=next

DJGPP 2.05 download and information:
http://devel.archefire.org/forum/viewtopic.php?hl=es&p=4306#p4306



http://www.zlib.net/zlib-1.2.11.tar.gz

https://sourceforge.net/projects/libpng/files/libpng14/1.4.21/lpng1421.zip/download



Add #include to stdio.h to all source files in the "tools/" directory that don't already include it, and also to parsegen.cpp in the root source directory.

Copy the libpng include files to the DJGPP include directory, no matter if you destroy it for other projects, you should modify a temporary install of DJGPP for this compilation. Do the same for zlib if any ZIP related errors appear during the compilation.


Edit the file makefile.ms and delete any -Ws GCC switch as DJGPP doesn't recognize it.
Also search for any -lpdcur occurrence and change it to -lpdc~1



------------------------------------------------
------------------------------------------------
------------------------------------------------
------------------------------------------------

How to Compile CWSDPMI 5 or 7

This is very important for learning how to use paging usefully in the real world with the NUR paging algorithm by [email protected]



Code:
Version 5:
http://ftp.gwdg.de/pub/msdos/gcc/djgpp/v2misc/csdpmi5s.zip

set path=%path%;\bc31\bin
cd \csdpmi5s\SRC\CWSDPMI
make
make -DRING=0

Version 7:
http://ftp.gwdg.de/pub/msdos/gcc/djgpp/v2misc/csdpmi7s.zip

set path=%path%;\bc31\bin
cd \csdpmi7s\SRC\CWSDPMI
make
make -DRING=0


Borland C++ 3.1 with TASM:
http://devel.archefire.org/downfile.php?path=/compilers/DOS/Borland/&filename=BC31INST.zip


_________________
Live PC 1: Image Live PC 2: Image

YouTube:
http://youtube.com/@AltComp126/streams
http://youtube.com/@proyectos/streams

http://master.dl.sourceforge.net/projec ... 7z?viasf=1


Top
 Profile  
 
 Post subject: Re: Share how to compile difficult programs
PostPosted: Fri Nov 03, 2017 10:09 am 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 11:12 pm
Posts: 281
AJ wrote:
+1

Surely if something is hard to compile using the build system recommended by the developer, that should be a bug that they need to fix so that it isn't hard to compile? Having said that, the only tools I ever compile are OSDev tools on Bash on Ubuntu on Windows, so maybe this view is slightly naïve.

Cheers,
Adam


Most often what happens is that, original plugins libraries become depreciated and project has been abandoned for a long time. All of a sudden, some customer has a request to make it work for the latest and greatest. Then even though, you can get it compiled with some efforts and hacks here and there, It will have loads of issues and a huge chunk will need to re written. But it is art to come up with solution with minimal changes so that your contributions to bugs is minimal. I am still learning the trade ...

--Thomas


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group