Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I'm working with some legacy FORTRAN 77–style code. Fixed with, comment lines starting with 'c' and continuation marks as the 6th character and so on. It's a lovely situation but nothing I can do about it.

I use Vim and something that's really annoying is when there's a comment like

code:
c The quick brown fox didn't jump over the lazy dog.

[some code here]
That ' mark completely messes up my syntax highlighting. Everything changes color, possibly because it's waiting for a closing ' mark. I'm using the Solarized theme if this makes any difference.

Is there a setting or something I can adjust to fix this? Right now what I do is just delete the offending ' mark, but it's a little bit annoying because I have to remember to add it back before I commit or else other people complain about it when I push it upstream.

Adbot
ADBOT LOVES YOU

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I have a project that I'm using make to build and it has say three targets: program1, program2, program3. I'm trying to do the following with make:

In my makefile:
code:
FFLAGS = -O0
FDEBUG = -warn all
FOPTIM = -O3

...

all: program1 program2 program3

program1:
    $(FC) $(FFLAGS) ...
When I do:
code:
$ make all
Makes program1, program2, program3. This is fine.

But I also want to be able to do something like:
code:
$ make debug program2 program3
The 'debug' flag should do something like
code:
FFLAGS += $(FOPTIM)
And then it should build program2 and program3 normally. Similarly 'make release program3' should do 'FFLAGS += $(FOPTIM)' and so on.

Right now I can do something like this:
code:
all: program1 program2 program3

debug: FFLAGS += $(FDEBUG)
debug: all
And it works in the sense that it will build 'all' with FFLAGS+FDEBUG but I want to be able to build individual targets. Basically I want debug and release to be treated like optional --options.

Can anyone help me out?

If it helps I will never need to do anything silly like: make debug program2 release program1 so it doesn't need to be too complicated.

Boris Galerkin fucked around with this message at 17:13 on Sep 9, 2016

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

JawnV6 posted:

Can you just pass RELEASE as an environment variable (make RELEASE=1 program1, or export it before invocation) then switch what you're doing based on that with ifeq?

nielsm posted:

Yeah don't try to abuse targets to modify the meaning of other targets. Just pass extra variables as JawnV6 suggests.

That worked, thanks.

Also spent a considerable amount of time now reading the manual and trying to understand examples and such. Now the implicit rules and things make more sense and I was able to simplify my makefile by a lot.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I have a really basic question about *-devel packages (at least on CentOS/RHEL): basically what are they? For example if I look at BLAS I see the following:

code:
blas-devel.x86_64 : BLAS development libraries
blas-static.x86_64 : BLAS static libraries
blas.x86_64 : The Basic Linear Algebra Subprograms library
From my understanding, the devel branches contains things like .h header files etc that I need if I want to use BLAS in my programs or compile/link programs against it. I guess what I don't understand is there a difference between blas and blas-devel? I can't really imagine a situation where I wouldn't need the header/include files but maybe I'm just not thinking outside my box.

The second question is, if I do a yum/dnf install blas-devel, do I also need to install blas as well?

Third question is something I just noticed when writing this. What is the static library? I've seen other packages have a static package too.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

nielsm posted:

The "blas" package contains the dynamically linked runtime libraries. You need this to run a program that links dynamically against BLAS.
The "blas-devel" package contains the headers required to compile a program against the BLAS library. Only required to compile programs, not to run them.
The "blas-static" package contains libraries for linking statically to, when compiling programs. Only required to compile programs, not to run them.

If you don't know the difference between static and dynamic linking, you should read up on that.
The simplified version is, static linking includes the complete code of the library into the main executable for the program. The static library is only required during build. Dynamic linking only inserts a reference to the library files and function names during build, and the OS loader then builds an in-memory image combining the main binary and the dynamic libraries. The dynamic libraries are required both during build and during runtime.

Jsor posted:

It depends to some degree on the exact build environment. A lot of C or C++ programs/libraries tend to require headers naming the BLAS functions they're linking to and need devel. You could specify or package in your own BLAS headers, of course, when distributing your library's source. This is also kind of how Python's C FFI bindings work, where you have to manually specify the functions signatures in Python, meaning you only need the .dll/.so/.dylib/.a file because you're essentially providing your own header and it's simply searching for the functions in the library at link time (when you call cdll.LoadLibrary generally). Rust's FFI works similarly.

In most cases, anything you find in yum/pacman/apt-get will be linked dynamically, but there are exceptions, hence why the static variant often gets a special listing.

Also, for BLAS specifically probably build OpenBLAS yourself. The one on apt-get tends to have iffy performance.


Depends on the environment I think. I've certainly had programs succeed at building when I had a malformed or misplaced dll/so, but then die at runtime.

Thanks you two. I'm from an aero/mech engineering background now doing a lot of HPC stuff. It's just I've always worked with proprietary/in house codes so there's never been an instance where I didn't need to (re)compile my code so the whole splitting of blas and blas-devel is new to me, though I get it now.

About the compiling OpenBLAS myself:

In general I always heard that this was a bad idea to use your own compiled software vs getting it from a package manager? I mean I have nothing to back this up or know where I even heard this from. It's just always been one of those "things" I've heard. Have I been completely misguided this entire time?

I know that compiling OpenBLAS myself and throwing it into /usr/lib64 or whatever is a bad idea but I thought that kind of extended to "compiling OpenBLAS yourself when it's available in the package manager for your distribution is a bad idea as well because ______." I mean if that's not the case then why should I not compile my own gcc/gfortran with "-O2 -march=native" and then use that to compile my own OpenBLAS, mpich, boost, etc. etc, and throw it all into ~/home/local/ ?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

UZR IS BULLSHIT posted:

I posted this in the scientific computing thread as well:

I feel like you're over complicating things by wanting to build it yourself? Why not use Moab or whatever free/alternative version? They were literally written to do what you want to do: distribute jobs across cores. "A large number of serial jobs on many cores." Is possible too. Just request a single core in your job scripts.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I have a question about logging practices. Basically what's the "best practice" placement of logging outputs? Here's a silly example

code:
# main is the executable called from the script
def main():
    logger.debug('calling do_something')
    do_something()
    logger.debug('do_something successful')

# random library function
def do_something():
    logger.debug('doing something')
    print('Hello world')
    logger.debug('something has been done')
Silly example aside is it considered better practice to write to a log outside of the function call but inside the main executable, inside the library function, or in both?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
There's a person's personal project on github that was last committed in 2018 and has an attached MIT license.

I forked it and modified some of the code, and then ended up rewriting most of the code in a different language. Before I push my changes back to my github repo what do I need to change/do to keep all the licensing stuff kosher? Do I need to rename the project/repo? Do I just change the copyright year/name in the LICENSE.txt file to reflect the current year/name or do I need to keep the original copy as-is and add my own?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Trying to write a custom program/script for Windows 10 that will send a keystroke to a specific minimized window at an interval without foregrounding said window. I can’t use AHK.

Never developed anything for/on a Windows PC before so I’m confused. What do I need to get this done? Language/API/dev env wise?

Boris Galerkin fucked around with this message at 17:26 on Aug 22, 2022

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

Volmarias posted:

Not to suggest this isn't possible, but this has the smell of an X/Y problem. What are you actually doing here?

I want to macro a boring thing in a video game. Literally just need to have it press “f” every 10 seconds, something like that.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

Hughmoris posted:

Who are you paying respects to?

My integrity, I guess.

E: I don’t know anything about development environments/languages for Windows. But if I can use C++ or Python that would be great.

E: https://stackoverflow.com/questions/13564851/how-to-generate-keyboard-events I think this and the other SO link above gives me enough information to get started.

Boris Galerkin fucked around with this message at 20:08 on Aug 22, 2022

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
It’s a free to play game I don’t give a poo poo.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

rjmccall posted:

Apparently you give enough of a poo poo to write a program to continuously trigger the optimal resource harvesting cooldowns, though

Well, yeah, but I don’t give a poo poo if I lose my account.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Is the "lib" in eg "libfoo" pronounced like "nib" with an "L" or is it pronounced like the first part of the word "library" (lieb?). I always thought it was pronounced like "lib" but this engineer at work has been calling it lieb and tbh I don't think I've ever talked to anyone about a lib in speech before.

Adbot
ADBOT LOVES YOU

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Thanks for the anecdote on how y'all pronounce lib. I'll keep saying lib like gib in my head.

For the people who pronounce lib like the first syllable of library, how do you say "bin" as in /bin? I've always called it bin as in trash bin but now I'm thinking some people call it bin like the first syllable of binary? For the German speaker upthread I guess this would be "bein" as in bone.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply