build a hello world program under sigclear
It is simple to use sigclear-develop for algorithm and program development.
We start with writing a hello-world program under sigclear.
It includes the following two text files in a project folder,
for example named as
test/:
Mhelloworld.c
// hello world
/* test program to say hello world */
#include < stdio.h>
int main(int argc, const char **argv)
{
printf("hello wolrd\n");
}
SConstruct
from program import *
SGBuild("sigclear-test")
local build
To build the project, just type the command
or simply
on the folder.
It will automatically build the binary program
sghelloworld and a manual file
sghelloworld.1 in the project folder.
To run the program and view the manual,
- ./sghelloworld
hello world
- man ./sghelloworld.1
build and install
To install the built programs, manuals, (and headers, libraries if possible)
in the sigclear system folder (/opt/sigclear/, must have written access),
To install them into other folder, such as
/opt/sigclear2/
- scons install prefix=/opt/sigclear2/
build an installable package
To build an installable package, type the following command in the shell
It will generate a
sigclear-test-1-0.el8.x86_64.rpm package on CentOS 8,
or a
sigclear-test-1-0.db9.x86_64.deb package on Debian 9.