Set up Java Python C/C++ FORTRAN Development Environment on SciTE
———————————————————————–
for Java and python, is already setup and work perfect on ubuntu, but
C and Fortran compilation does not work without setup
here is how I setup the scite
——————————–
# Indentation for python
tabsize=4
indent.size=4
use.tabs=0
#indent.auto=1
indent.automatic=1
indent.opening=1
indent.closing=1
#tab.indents=4
#backspace.unindents=4
——————————-
ccopts=-pedantic -Os
cc=g++ $(ccopts) -c $(FileNameExt) -o $(FileName).o
ccc=gcc $(ccopts) -c $(FileNameExt) -o $(FileName).o
make.command=make
command.compile.*.c=$(ccc) -std=c99
command.build.*.c=$(make.command)
command.build.*.h=$(make.command)
command.go.*.c=./$(FileName)
# most important, uncomment this line
# To make the Go command both compile (if needed) and execute, use this setting:
command.go.needs.*.c=gcc $(ccopts) -std=c99 $(FileNameExt) -o $(FileName)
—————————userProperties
file——————————————-
ccopts=
————————–CFLAGS———————————
# # set the ccopts for wxWidgets
# OpenGL -lglut -lGL -lGLU -lX11 -lm
# `wx-config –cxxflags` `wx-config –libs`
# OpenCL
## write a make for multiple fiels
ccopts=-pedantic -Os -lglut -lGL -lGLU -lX11 -lm `wx-config
–cxxflags` `wx-config –libs`
———————————————————————
we need a make file for multiple files CC
a template of makefile is attached
————————-
# how to setup the compile options?
gfortran is just like gcc,
gfortran [-c|-S|-E] [-g] [-pg] [-Olevel] [-Wwarn…] [-pedantic]
[-Idir…] [-Ldir…] [-Dmacro[=defn]…] [-Umacro] [-foption…]
#add a var: fcopts= in userProperties file, so It can be change
options quickly for
# how to add fortran cc options, add more lib module? such as Lapack blas lib
fcopts=-L/usr/local/lib -llapack -lblas
# change the compile command to compile and link the single file mode:
# fc90=gfortran -c -o $(FileName).o $(FileNameExt)
# change to directly compile and link fotran
# fc90=gfortran -o $(FileName) $(fcopts) $(FileNameExt)
# a ./ is need to add to run the program:
# command.go.*.f=./$(FileName)
for multiple file . use a makefile
———————————————————————
open *.py by scite
———————————————————————–
——————————chinese input support——————
(1):在Internationalisation一段中,增加code.page=936和character.set=134两行,
其他的都注释掉。不然选择中文时出现乱码。这两项是中文的字符编码。
———————————-
———————————————-
grep gedit /usr/share/applications/defaults.list | sed s/gedit/scribes/g
It is possible to set any mime type and any program that has a *.desktop entry.
Find out your favorite program’s desktop entry by looking in this folder:
/usr/share/applications/
set as default python editor
text/x-python=gedit.desktop
text/x-csrc=gedit.desktop # C/C++ files
change to scite.desktop
————————————————————————————————————
following words are copied from internet: with some of my commend
Anon 21:41, after some struggle, this is what ended up working for me:
$ sudo update-alternatives –install Scite gnome-text-editor /usr/bin/scite 1
————-I got error?———–
update-alternatives: error: alternative link is not absolute as it
should be: Scite
——————————————
$ sudo update-alternatives –config gnome-text-editor
# here, I noticed a symlink was gone – but most likely because I was
messing with the system previously
$ ls -la /usr/bin/gnome-text-editor
ls: cannot access /usr/bin/gnome-text-editor: No such file or directory
sudo ln -s /etc/alternatives/gnome-text-editor /usr/bin/gnome-text-editor
# test from command line (with existing test.txt file in the calling folder)
/usr/bin/gnome-text-editor test.txt
# all fine here, yet right-click and “open with Text Editor” in
Nautilus still fails
# edit:
$ nano ~/.local/share/applications/mimeapps.list
# and you can notice that for text/plain, gedit.desktop is first in
the list, and scite.desktop is last; simply make scite.desktop first:
# text/plain=scite.desktop;openoffice.org-writer.desktop;userapp-gedit-S5E6VU.desktop;wine-extension-txt.desktop;geany.desktop;gedit.desktop;
#Usage: copy and paste it as Makefile without any suffix in your project folder
########################################
# this make file does not follow the dir and var standard of
# The GNU Coding Standards
# only for tiny project
########################################
# By default, when make looks for the makefile, it tries the following names,
# in order: `GNUmakefile’, `makefile’ and `Makefile’.
# ./configure can set the correct env var,
#
# example of schared lib compilation
#gcc -shared -Wl,-soname libname.so.verNo -o library_name file_list library_list
#
# conditional set var: a space need between ifeq and ()
# Please change source file suffix, .c .C or cpp or .f90 to fit your project
SUFFIX=.c
ifeq ($(SUFFIX), .c)
CC=gcc
endif
ifeq ($(SUFFIX), .C)
CC=g++
endif
ifeq ($(SUFFIX), .cpp)
CC=g++
endif
#$(findstring $(SUFFIX), .f90 .f .F .f95 .F90)
ifeq ($(findstring $(SUFFIX), .f90 .f .F .f95 .F90), find)
CC=gfortran
endif
#########################################
EXE=scube
#work dir is pwd
prefix=.
OBJDIR=.
#${prefix}/obj
#####################################
#
# # set the ccopts for wxWidgets
# OpenGL -lglut -lGL -lGLU -lX11 -lm
# `wx-config –cxxflags` `wx-config –libs`
# OpenCL
#
INCDIR=.
CFLAGS= -Wall -O1 -I$(INCDIR)
LIBDIR =/usr/lib
LIBS=-lglut -lGL -lGLU -lX11 -lm
##########################################
#Global substitution in a string is done by patsubst: m4
#patsubst(string, regexp, opt replacement)
#
# header obj files list: multiple separated by space
_DEPS =
DEPS = $(patsubst %,$(INCDIR)/%,$(_DEPS))
# special macros $@ and $^,
# which are the left and right sides of the :
# $(patsubst ) is built-in macro of m4
_OBJ=scube.o
OBJ = $(patsubst %,$(OBJDIR)/%,$(_OBJ))
#compiling $<
$(OBJDIR)/%.o: %$(SUFFIX) $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
#link
$(EXE): $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -f $(OBJDIR)/*.o