How to make sublime text see .mod files in different folders? - fortran

In my program I use multiple module files. In order to keep main folder clean I moved all of them in separate folders and made necessary changes to my shell script. Everything was done correctly as now I am able to compile and run the program. Unfortunately, Sublime Text 3 doesn't see .mod files located not in the main folder. On lines like this:
use mymodule
it says:
Fatal Error: Can't open module file ‘mymodule.mod’ for reading at (1): No such file or directory
How can I fix this?

In Sublime Text go to Preferences->Package Settings->SublimeLinter->Settings - User. There in the block "gfortranfixedform" or "gfortranmodern" (depends on what form you are using) add an argument: "args": ["-Ipath/to/modfiles"], where path/to/modfiles is a directory with your .mod files.

Maybe you have to change the line in config to this:
"shell_cmd": "gfortran '${file}' -Ipath/to/module -o '${file_path}/${file_base_name}'"
where path/to/module is a directory with your .mod file. (Just a suggestion, don't know anything about Sublime editor.)

Related

File watcher: "An output directory must be specified when compiling a directory"

cmd.exe /D /C call C:\Users\sebas\AppData\Roaming\npm\node-sass.cmd style.scss:style.css
An output directory must be specified when compiling a directory
The scss file I want the file watcher to watch is placed at the root of my project.
Watch the error appear: gif_link
How do I fix this error?
If you like the .css files to be generated in the same folder as original file, try the following settings:
Note the Create output file from stdout option - it has to be enabled, as node-sass writes CSS to stdout unless the -o option is passed.
If you like to place generated files in a separate folder, use the -o option:
I got same error working with webpack bundler and setting my scripts in package.json
In my case to resolve this issue you need to add output directory ( -o name-of-directory).
If working with scripts in package.json it should look like this:
scripts: {
"scss": "node-sass --watch src -o src"
}
src is folder where sass file which I want to compile is placed.
It means compile sass from src folder and send compiled files to src folder.
In this case css file will be placed on same place where sass file already is.
With node-sass for me is working to set Arguments to
$FileName$ -o . $FileNameWithoutExtension$.css
and unchecked "Create output file from stdout".

How do I specify where the dsc, build, changes, update, tar.gz files go when running debuild?

Once in a while I like to send a version of my software to my Ubuntu PPA on Launchpad. To do so, I need to regenerate the source, description, and change files. To do that, I run the following command:
debuild -S -sa -nc -m"alexis#example.com"
The problem is that it spits out all the files one directory up from my main folder. So say I am working on a project named Beautiful, I would see:
projects/
projects/Beautiful/
projects/Beautiful/<source files from my git>
projects/Beautiful_1.2.3~xenial.dsc
projects/Beautiful_1.2.3~xenial_source.build
projects/Beautiful_1.2.3~xenial_source.changes
projects/Beautiful_1.2.3~xenial_source.ppa.upload
projects/Beautiful_1.2.3~xenial.tar.gz
I would like to place all of the source files in a sub-folder such as:
projects/
projects/Beautiful/
projects/Beautiful/<source files from my git>
projects/Beautiful_source/Beautiful_1.2.3~xenial.dsc
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.build
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.changes
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.ppa.upload
projects/Beautiful_source/Beautiful_1.2.3~xenial.tar.gz
Is it possible from the command line or a rule somewhere? Or is the one directory up the only place where debuild will work on that?

Adding extension to file via filewatcher in WebStorm 9

I frequently have to send JS files through Outlook, which means that I have to modify the extension of the file to txt or the like so the recipient can receive it. I'd ideally like to implement a file watcher in WebStorm to simply output a child file with .txt appended to it similar to how it'll show a child CSS file for a LESS file.
To sum up, given a file named "file.js", I would like it to output a "file.js.txt" as well whenever I make a change.
Is there any simple way to go about doing this?
You can create a .bat file (shell script) that would copy files and then configure it as a file watcher. Like:
copy %1 %2 /Y
Watcher settings:
Program: path/to/your/batfile.bat
Arguments: $FileName$ $FileName$.txt
Working directory: $FileDir$
Output paths: $FileName$.txt

Full path of *.cpp files

I need to have full path of C++ files (name of file is not neccesary). It musn't to be depended on path of execution.
I can use __FILE__, hovewer it gives me only name of file. I was seeking in boost::filesystem, but I only found boost::filesystem::current_path() - unfortunately it gives me path of directory from which I run program.
I looking for path of cpp file, not path of exe. I need it for other tool to generate groups of cpp files after directory of cpp files.
Any ideas?
Edit:
Maybe it is possible to use bash script which gives actual directory of cpp file (not sh file)?

Xcode 4 file input/output, command line tool C++

I'm trying to figure out where to save multiple .txt files so that i can have a command line tool project in Xcode read directly in from them while running it.
I understand that Xcode compiles everything to a folder, DerivedData, which i have saved in the same location as my source code for each project respectively.
can i save multiple .txt files anywhere in the DerivedData folder or include it in the build settings and phases so that when i run the command line tool i can type the name of a file, it will read in from that file.
By default the compiled/linked binary will look into its own directory for files.
For example, my binaries are at ProjectName/Build/Products/Debug/ and therefore it will look for files from that dir.
You can use relative path from that folder to the outside.
Or, you can create a symbolic link to another directory (on Terminal):
ln -s source_dir target_file
target_file must be located in the same directory as your binary. And you can reference the other files like "target_file/file1.txt", etc.